Rename globalshortcuts GSD D-Bus backend to avoid confusion
This commit is contained in:
parent
ad141c165b
commit
9983dc3138
|
@ -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
|
||||
|
|
|
@ -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();
|
|
@ -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;
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue