Rename globalshortcuts GSD D-Bus backend to avoid confusion

This commit is contained in:
Jonas Kvinge
2019-01-24 20:17:50 +01:00
parent ad141c165b
commit 9983dc3138
4 changed files with 18 additions and 18 deletions

View File

@@ -527,8 +527,8 @@ if(HAVE_GLOBALSHORTCUTS)
SOURCES globalshortcuts/globalshortcut-x11.cpp SOURCES globalshortcuts/globalshortcut-x11.cpp
) )
optional_source(HAVE_DBUS optional_source(HAVE_DBUS
SOURCES globalshortcuts/globalshortcutbackend-dbus.cpp SOURCES globalshortcuts/globalshortcutbackend-gsd.cpp
HEADERS globalshortcuts/globalshortcutbackend-dbus.h HEADERS globalshortcuts/globalshortcutbackend-gsd.h
) )
optional_source(WIN32 optional_source(WIN32
SOURCES globalshortcuts/globalshortcut-win.cpp SOURCES globalshortcuts/globalshortcut-win.cpp

View File

@@ -35,20 +35,20 @@
#include "core/logging.h" #include "core/logging.h"
#include "globalshortcuts.h" #include "globalshortcuts.h"
#include "globalshortcutbackend.h" #include "globalshortcutbackend.h"
#include "globalshortcutbackend-dbus.h" #include "globalshortcutbackend-gsd.h"
const char *GlobalShortcutBackendDBus::kGsdService = "org.gnome.SettingsDaemon.MediaKeys"; const char *GlobalShortcutBackendGSD::kGsdService = "org.gnome.SettingsDaemon.MediaKeys";
const char *GlobalShortcutBackendDBus::kGsdService2 = "org.gnome.SettingsDaemon"; const char *GlobalShortcutBackendGSD::kGsdService2 = "org.gnome.SettingsDaemon";
const char *GlobalShortcutBackendDBus::kGsdPath = "/org/gnome/SettingsDaemon/MediaKeys"; const char *GlobalShortcutBackendGSD::kGsdPath = "/org/gnome/SettingsDaemon/MediaKeys";
GlobalShortcutBackendDBus::GlobalShortcutBackendDBus(GlobalShortcuts *parent) GlobalShortcutBackendGSD::GlobalShortcutBackendGSD(GlobalShortcuts *parent)
: GlobalShortcutBackend(parent), : GlobalShortcutBackend(parent),
interface_(nullptr), interface_(nullptr),
is_connected_(false) {} is_connected_(false) {}
GlobalShortcutBackendDBus::~GlobalShortcutBackendDBus(){} GlobalShortcutBackendGSD::~GlobalShortcutBackendGSD(){}
bool GlobalShortcutBackendDBus::DoRegister() { bool GlobalShortcutBackendGSD::DoRegister() {
qLog(Debug) << "Registering"; qLog(Debug) << "Registering";
@@ -75,7 +75,7 @@ bool GlobalShortcutBackendDBus::DoRegister() {
} }
void GlobalShortcutBackendDBus::RegisterFinished(QDBusPendingCallWatcher *watcher) { void GlobalShortcutBackendGSD::RegisterFinished(QDBusPendingCallWatcher *watcher) {
QDBusMessage reply = watcher->reply(); QDBusMessage reply = watcher->reply();
watcher->deleteLater(); watcher->deleteLater();
@@ -92,7 +92,7 @@ void GlobalShortcutBackendDBus::RegisterFinished(QDBusPendingCallWatcher *watche
} }
void GlobalShortcutBackendDBus::DoUnregister() { void GlobalShortcutBackendGSD::DoUnregister() {
qLog(Debug) << "Unregister"; qLog(Debug) << "Unregister";
@@ -108,7 +108,7 @@ void GlobalShortcutBackendDBus::DoUnregister() {
} }
void GlobalShortcutBackendDBus::GnomeMediaKeyPressed(const QString&, const QString& key) { void GlobalShortcutBackendGSD::GnomeMediaKeyPressed(const QString&, const QString& key) {
if (key == "Play") manager_->shortcuts()["play_pause"].action->trigger(); if (key == "Play") manager_->shortcuts()["play_pause"].action->trigger();
if (key == "Stop") manager_->shortcuts()["stop"].action->trigger(); if (key == "Stop") manager_->shortcuts()["stop"].action->trigger();
if (key == "Next") manager_->shortcuts()["next_track"].action->trigger(); if (key == "Next") manager_->shortcuts()["next_track"].action->trigger();

View File

@@ -38,12 +38,12 @@
class GlobalShortcuts; class GlobalShortcuts;
class OrgGnomeSettingsDaemonMediaKeysInterface; class OrgGnomeSettingsDaemonMediaKeysInterface;
class GlobalShortcutBackendDBus : public GlobalShortcutBackend { class GlobalShortcutBackendGSD : public GlobalShortcutBackend {
Q_OBJECT Q_OBJECT
public: public:
explicit GlobalShortcutBackendDBus(GlobalShortcuts *parent); explicit GlobalShortcutBackendGSD(GlobalShortcuts *parent);
~GlobalShortcutBackendDBus(); ~GlobalShortcutBackendGSD();
static const char *kGsdService; static const char *kGsdService;
static const char *kGsdService2; static const char *kGsdService2;

View File

@@ -37,7 +37,7 @@
#include "globalshortcutbackend.h" #include "globalshortcutbackend.h"
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
# include "globalshortcutbackend-dbus.h" # include "globalshortcutbackend-gsd.h"
#endif #endif
#if defined(HAVE_X11) || defined(Q_OS_WIN) #if defined(HAVE_X11) || defined(Q_OS_WIN)
# include "globalshortcutbackend-system.h" # include "globalshortcutbackend-system.h"
@@ -80,7 +80,7 @@ GlobalShortcuts::GlobalShortcuts(QWidget *parent)
// Create backends - these do the actual shortcut registration // Create backends - these do the actual shortcut registration
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
dbus_backend_ = new GlobalShortcutBackendDBus(this); dbus_backend_ = new GlobalShortcutBackendGSD(this);
#endif #endif
#if defined(HAVE_X11) || defined(Q_OS_WIN) #if defined(HAVE_X11) || defined(Q_OS_WIN)
@@ -134,7 +134,7 @@ GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString &id, const
bool GlobalShortcuts::IsGsdAvailable() const { bool GlobalShortcuts::IsGsdAvailable() const {
#ifdef HAVE_DBUS #ifdef HAVE_DBUS
return QDBusConnection::sessionBus().interface()->isServiceRegistered(GlobalShortcutBackendDBus::kGsdService) || QDBusConnection::sessionBus().interface()->isServiceRegistered(GlobalShortcutBackendDBus::kGsdService2); return QDBusConnection::sessionBus().interface()->isServiceRegistered(GlobalShortcutBackendGSD::kGsdService) || QDBusConnection::sessionBus().interface()->isServiceRegistered(GlobalShortcutBackendGSD::kGsdService2);
#else #else
return false; return false;
#endif #endif