Includes, comments and bugfixes

- Fix includes
- Use common regex (Song::kCoverRemoveDisc) for removing Disc/CD from album
- Remove Disc/CD from album when creating hash
- Make imobiledevice support compile
- Fix setting device on windows
This commit is contained in:
Jonas Kvinge
2018-05-01 00:41:33 +02:00
parent fccbd6790c
commit e337b7933b
518 changed files with 7003 additions and 4693 deletions

View File

@@ -20,8 +20,9 @@
#include "config.h"
#include "globalshortcutbackend.h"
#include <QObject>
#include "globalshortcutbackend.h"
#include "globalshortcuts.h"
GlobalShortcutBackend::GlobalShortcutBackend(GlobalShortcuts *parent)
@@ -37,4 +38,3 @@ void GlobalShortcutBackend::Unregister() {
DoUnregister();
active_ = false;
}

View File

@@ -23,6 +23,8 @@
#include "config.h"
#include <stdbool.h>
#include <QString>
#include <QObject>
class GlobalShortcuts;
@@ -51,4 +53,3 @@ signals:
};
#endif // GLOBALSHORTCUTBACKEND_H

View File

@@ -20,11 +20,20 @@
#include "config.h"
#include <QDialog>
#include <QWidget>
#include <QString>
#include <QStringBuilder>
#include <QLabel>
#include <QKeySequence>
#include <QtEvents>
#include "globalshortcutgrabber.h"
#include "ui_globalshortcutgrabber.h"
#include <QtDebug>
#include <QKeyEvent>
class QShowEvent;
class QHideEvent;
class QKeyEvent;
GlobalShortcutGrabber::GlobalShortcutGrabber(QWidget *parent)
: QDialog(parent), ui_(new Ui::GlobalShortcutGrabber) {
@@ -95,5 +104,3 @@ bool GlobalShortcutGrabber::event(QEvent *e) {
void GlobalShortcutGrabber::UpdateText() {
ui_->combo->setText("<b>" + ret_.toString(QKeySequence::NativeText) + "</b>");
}

View File

@@ -23,7 +23,19 @@
#include "config.h"
#include <stdbool.h>
#include <QObject>
#include <QWidget>
#include <QDialog>
#include <QList>
#include <QString>
#include <QKeySequence>
#include <QtEvents>
class QEvent;
class QHideEvent;
class QShowEvent;
class MacMonitorWrapper;
class Ui_GlobalShortcutGrabber;
@@ -41,7 +53,7 @@ class GlobalShortcutGrabber : public QDialog {
GlobalShortcutGrabber(QWidget *parent = nullptr);
~GlobalShortcutGrabber();
QKeySequence GetKey(const QString& name);
QKeySequence GetKey(const QString &name);
protected:
bool event(QEvent *);

View File

@@ -18,7 +18,7 @@
*
*/
#include "config.h"
#include "config.h"
#include "globalshortcutgrabber.h"

View File

@@ -20,24 +20,23 @@
#include "config.h"
#include <QWidget>
#include <QVariant>
#include <QString>
#include <QAction>
#include <QShortcut>
#include <QKeySequence>
#ifdef QT_DBUS_LIB
# include <QDBusConnectionInterface>
#endif
#include "globalshortcuts.h"
#include "globalshortcutbackend.h"
#include "gnomeglobalshortcutbackend.h"
#include "macglobalshortcutbackend.h"
#include "qxtglobalshortcutbackend.h"
#include "settings/shortcutssettingspage.h"
#include "core/mac_startup.h"
#include <QAction>
#include <QShortcut>
#include <QSignalMapper>
#include <QtDebug>
#ifdef QT_DBUS_LIB
#include <QtDBus>
#endif
GlobalShortcuts::GlobalShortcuts(QWidget* parent)
GlobalShortcuts::GlobalShortcuts(QWidget *parent)
: QWidget(parent),
gnome_backend_(nullptr),
system_backend_(nullptr),
@@ -77,13 +76,13 @@ GlobalShortcuts::GlobalShortcuts(QWidget* parent)
}
void GlobalShortcuts::AddShortcut(const QString& id, const QString& name, const char* signal, const QKeySequence& default_key) {
void GlobalShortcuts::AddShortcut(const QString &id, const QString &name, const char *signal, const QKeySequence &default_key) {
Shortcut shortcut = AddShortcut(id, name, default_key);
connect(shortcut.action, SIGNAL(triggered()), this, signal);
}
GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString& id, const QString& name, const QKeySequence& default_key) {
GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString &id, const QString &name, const QKeySequence &default_key) {
Shortcut shortcut;
shortcut.action = new QAction(name, this);
@@ -106,8 +105,7 @@ GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString& id, const
bool GlobalShortcuts::IsGsdAvailable() const {
#ifdef QT_DBUS_LIB
return QDBusConnection::sessionBus().interface()->isServiceRegistered(
GnomeGlobalShortcutBackend::kGsdService);
return QDBusConnection::sessionBus().interface()->isServiceRegistered(GnomeGlobalShortcutBackend::kGsdService);
#else // QT_DBUS_LIB
return false;
#endif
@@ -116,8 +114,7 @@ bool GlobalShortcuts::IsGsdAvailable() const {
void GlobalShortcuts::ReloadSettings() {
// The actual shortcuts have been set in our actions for us by the config
// dialog already - we just need to reread the gnome settings.
// The actual shortcuts have been set in our actions for us by the config dialog already - we just need to reread the gnome settings.
use_gnome_ = settings_.value("use_gnome", true).toBool();
Unregister();

View File

@@ -23,22 +23,25 @@
#include "config.h"
#include <QKeySequence>
#include <QMap>
#include <QSettings>
#include <QWidget>
#include <stdbool.h>
class QAction;
class QShortcut;
#include <QObject>
#include <QWidget>
#include <QMap>
#include <QString>
#include <QAction>
#include <QShortcut>
#include <QSignalMapper>
#include <QKeySequence>
#include <QSettings>
class GlobalShortcutBackend;
class QSignalMapper;
class GlobalShortcuts : public QWidget {
Q_OBJECT
public:
explicit GlobalShortcuts(QWidget* parent = nullptr);
explicit GlobalShortcuts(QWidget *parent = nullptr);
struct Shortcut {
QString id;

View File

@@ -20,23 +20,27 @@
#include "config.h"
#include "gnomeglobalshortcutbackend.h"
#include "globalshortcuts.h"
#include "core/closure.h"
#include "core/logging.h"
#ifdef QT_DBUS_LIB
# include <QCoreApplication>
# include <QDBusConnectionInterface>
# include <QDBusMessage>
# include <QDBusPendingCall>
# include <QDBusPendingReply>
#endif
#include <QAction>
#include <QDateTime>
#include <QMap>
#include <QtDebug>
#ifdef QT_DBUS_LIB
#include "dbus/gnomesettingsdaemon.h"
#endif
#include <QAction>
#include <QCoreApplication>
#include <QDateTime>
#include <QtDebug>
#ifdef QT_DBUS_LIB
#include <QtDBus>
#endif
#include "core/closure.h"
#include "core/logging.h"
#include "globalshortcuts.h"
#include "globalshortcuts/globalshortcutbackend.h"
#include "gnomeglobalshortcutbackend.h"
const char *GnomeGlobalShortcutBackend::kGsdService = "org.gnome.SettingsDaemon";
const char *GnomeGlobalShortcutBackend::kGsdPath = "/org/gnome/SettingsDaemon/MediaKeys";
@@ -48,6 +52,7 @@ GnomeGlobalShortcutBackend::GnomeGlobalShortcutBackend(GlobalShortcuts *parent)
is_connected_(false) {}
bool GnomeGlobalShortcutBackend::DoRegister() {
#ifdef QT_DBUS_LIB
qLog(Debug) << "registering";
// Check if the GSD service is available
@@ -70,9 +75,11 @@ bool GnomeGlobalShortcutBackend::DoRegister() {
qLog(Warning) << "dbus not available";
return false;
#endif
}
void GnomeGlobalShortcutBackend::RegisterFinished(QDBusPendingCallWatcher *watcher) {
#ifdef QT_DBUS_LIB
QDBusMessage reply = watcher->reply();
watcher->deleteLater();
@@ -87,9 +94,11 @@ void GnomeGlobalShortcutBackend::RegisterFinished(QDBusPendingCallWatcher *watch
qLog(Debug) << "registered";
#endif // QT_DBUS_LIB
}
void GnomeGlobalShortcutBackend::DoUnregister() {
qLog(Debug) << "unregister";
#ifdef QT_DBUS_LIB
// Check if the GSD service is available
@@ -100,8 +109,9 @@ void GnomeGlobalShortcutBackend::DoUnregister() {
is_connected_ = false;
interface_->ReleaseMediaPlayerKeys(QCoreApplication::applicationName());
disconnect(interface_, SIGNAL(MediaPlayerKeyPressed(QString,QString)), this, SLOT(GnomeMediaKeyPressed(QString,QString)));
disconnect(interface_, SIGNAL(MediaPlayerKeyPressed(QString, QString)), this, SLOT(GnomeMediaKeyPressed(QString, QString)));
#endif
}
void GnomeGlobalShortcutBackend::GnomeMediaKeyPressed(const QString&, const QString& key) {

View File

@@ -21,13 +21,16 @@
#ifndef GNOMEGLOBALSHORTCUTBACKEND_H
#define GNOMEGLOBALSHORTCUTBACKEND_H
#include "config.h"
#include <stdbool.h>
#include <QObject>
#include <QString>
#include "config.h"
#include "globalshortcutbackend.h"
class OrgGnomeSettingsDaemonMediaKeysInterface;
class QDBusPendingCallWatcher;
class GlobalShortcuts;
class OrgGnomeSettingsDaemonMediaKeysInterface;
class GnomeGlobalShortcutBackend : public GlobalShortcutBackend {
Q_OBJECT

View File

@@ -27,11 +27,12 @@
#include "globalshortcutbackend.h"
#include <QKeySequence>
#include <QObject>
#include <QMap>
#include <QAction>
#include <QKeySequence>
class MacGlobalShortcutBackendPrivate;
class QAction;
class MacGlobalShortcutBackend : public GlobalShortcutBackend {
Q_OBJECT

View File

@@ -20,13 +20,17 @@
#include "config.h"
#include "globalshortcuts.h"
#include "qxtglobalshortcutbackend.h"
#include "qxtglobalshortcut.h"
#include "core/logging.h"
#include <QObject>
#include <QMap>
#include <QAction>
#include <QtDebug>
#include <QKeySequence>
#include <QtAlgorithms>
#include "core/logging.h"
#include "globalshortcuts.h"
#include "globalshortcutbackend.h"
#include "qxtglobalshortcut.h"
#include "qxtglobalshortcutbackend.h"
QxtGlobalShortcutBackend::QxtGlobalShortcutBackend(GlobalShortcuts* parent) : GlobalShortcutBackend(parent) {}

View File

@@ -23,8 +23,13 @@
#include "config.h"
#include <stdbool.h>
#include <QAction>
#include <QList>
#include "globalshortcutbackend.h"
class GlobalShortcuts;
class QxtGlobalShortcut;
class QxtGlobalShortcutBackend : public GlobalShortcutBackend {