From 9983dc31384a84188b9f0dffff8ddd2daa453592 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 24 Jan 2019 20:17:50 +0100 Subject: [PATCH] Rename globalshortcuts GSD D-Bus backend to avoid confusion --- src/CMakeLists.txt | 4 ++-- ...dbus.cpp => globalshortcutbackend-gsd.cpp} | 20 +++++++++---------- ...end-dbus.h => globalshortcutbackend-gsd.h} | 6 +++--- src/globalshortcuts/globalshortcuts.cpp | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) rename src/globalshortcuts/{globalshortcutbackend-dbus.cpp => globalshortcutbackend-gsd.cpp} (82%) rename src/globalshortcuts/{globalshortcutbackend-dbus.h => globalshortcutbackend-gsd.h} (91%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d7074f81d..d684a6124 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -527,8 +527,8 @@ if(HAVE_GLOBALSHORTCUTS) SOURCES globalshortcuts/globalshortcut-x11.cpp ) optional_source(HAVE_DBUS - SOURCES globalshortcuts/globalshortcutbackend-dbus.cpp - HEADERS globalshortcuts/globalshortcutbackend-dbus.h + SOURCES globalshortcuts/globalshortcutbackend-gsd.cpp + HEADERS globalshortcuts/globalshortcutbackend-gsd.h ) optional_source(WIN32 SOURCES globalshortcuts/globalshortcut-win.cpp diff --git a/src/globalshortcuts/globalshortcutbackend-dbus.cpp b/src/globalshortcuts/globalshortcutbackend-gsd.cpp similarity index 82% rename from src/globalshortcuts/globalshortcutbackend-dbus.cpp rename to src/globalshortcuts/globalshortcutbackend-gsd.cpp index 620fdf35b..7b084ff4d 100644 --- a/src/globalshortcuts/globalshortcutbackend-dbus.cpp +++ b/src/globalshortcuts/globalshortcutbackend-gsd.cpp @@ -35,20 +35,20 @@ #include "core/logging.h" #include "globalshortcuts.h" #include "globalshortcutbackend.h" -#include "globalshortcutbackend-dbus.h" +#include "globalshortcutbackend-gsd.h" -const char *GlobalShortcutBackendDBus::kGsdService = "org.gnome.SettingsDaemon.MediaKeys"; -const char *GlobalShortcutBackendDBus::kGsdService2 = "org.gnome.SettingsDaemon"; -const char *GlobalShortcutBackendDBus::kGsdPath = "/org/gnome/SettingsDaemon/MediaKeys"; +const char *GlobalShortcutBackendGSD::kGsdService = "org.gnome.SettingsDaemon.MediaKeys"; +const char *GlobalShortcutBackendGSD::kGsdService2 = "org.gnome.SettingsDaemon"; +const char *GlobalShortcutBackendGSD::kGsdPath = "/org/gnome/SettingsDaemon/MediaKeys"; -GlobalShortcutBackendDBus::GlobalShortcutBackendDBus(GlobalShortcuts *parent) +GlobalShortcutBackendGSD::GlobalShortcutBackendGSD(GlobalShortcuts *parent) : GlobalShortcutBackend(parent), interface_(nullptr), is_connected_(false) {} -GlobalShortcutBackendDBus::~GlobalShortcutBackendDBus(){} +GlobalShortcutBackendGSD::~GlobalShortcutBackendGSD(){} -bool GlobalShortcutBackendDBus::DoRegister() { +bool GlobalShortcutBackendGSD::DoRegister() { qLog(Debug) << "Registering"; @@ -75,7 +75,7 @@ bool GlobalShortcutBackendDBus::DoRegister() { } -void GlobalShortcutBackendDBus::RegisterFinished(QDBusPendingCallWatcher *watcher) { +void GlobalShortcutBackendGSD::RegisterFinished(QDBusPendingCallWatcher *watcher) { QDBusMessage reply = watcher->reply(); watcher->deleteLater(); @@ -92,7 +92,7 @@ void GlobalShortcutBackendDBus::RegisterFinished(QDBusPendingCallWatcher *watche } -void GlobalShortcutBackendDBus::DoUnregister() { +void GlobalShortcutBackendGSD::DoUnregister() { 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 == "Stop") manager_->shortcuts()["stop"].action->trigger(); if (key == "Next") manager_->shortcuts()["next_track"].action->trigger(); diff --git a/src/globalshortcuts/globalshortcutbackend-dbus.h b/src/globalshortcuts/globalshortcutbackend-gsd.h similarity index 91% rename from src/globalshortcuts/globalshortcutbackend-dbus.h rename to src/globalshortcuts/globalshortcutbackend-gsd.h index 0fd828086..af418e07d 100644 --- a/src/globalshortcuts/globalshortcutbackend-dbus.h +++ b/src/globalshortcuts/globalshortcutbackend-gsd.h @@ -38,12 +38,12 @@ class GlobalShortcuts; class OrgGnomeSettingsDaemonMediaKeysInterface; -class GlobalShortcutBackendDBus : public GlobalShortcutBackend { +class GlobalShortcutBackendGSD : public GlobalShortcutBackend { Q_OBJECT public: - explicit GlobalShortcutBackendDBus(GlobalShortcuts *parent); - ~GlobalShortcutBackendDBus(); + explicit GlobalShortcutBackendGSD(GlobalShortcuts *parent); + ~GlobalShortcutBackendGSD(); static const char *kGsdService; static const char *kGsdService2; diff --git a/src/globalshortcuts/globalshortcuts.cpp b/src/globalshortcuts/globalshortcuts.cpp index 08cc6ef53..9aacdb44c 100644 --- a/src/globalshortcuts/globalshortcuts.cpp +++ b/src/globalshortcuts/globalshortcuts.cpp @@ -37,7 +37,7 @@ #include "globalshortcutbackend.h" #ifdef HAVE_DBUS -# include "globalshortcutbackend-dbus.h" +# include "globalshortcutbackend-gsd.h" #endif #if defined(HAVE_X11) || defined(Q_OS_WIN) # include "globalshortcutbackend-system.h" @@ -80,7 +80,7 @@ GlobalShortcuts::GlobalShortcuts(QWidget *parent) // Create backends - these do the actual shortcut registration #ifdef HAVE_DBUS - dbus_backend_ = new GlobalShortcutBackendDBus(this); + dbus_backend_ = new GlobalShortcutBackendGSD(this); #endif #if defined(HAVE_X11) || defined(Q_OS_WIN) @@ -134,7 +134,7 @@ GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString &id, const bool GlobalShortcuts::IsGsdAvailable() const { #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 return false; #endif