diff --git a/src/globalshortcuts/globalshortcuts.cpp b/src/globalshortcuts/globalshortcuts.cpp index c8c9db098..15eec5ac6 100644 --- a/src/globalshortcuts/globalshortcuts.cpp +++ b/src/globalshortcuts/globalshortcuts.cpp @@ -26,7 +26,7 @@ #include #include #include -#ifdef QT_DBUS_LIB +#ifdef HAVE_DBUS # include #endif @@ -108,9 +108,9 @@ GlobalShortcuts::Shortcut GlobalShortcuts::AddShortcut(const QString &id, const bool GlobalShortcuts::IsGsdAvailable() const { -#ifdef QT_DBUS_LIB +#ifdef HAVE_DBUS return QDBusConnection::sessionBus().interface()->isServiceRegistered(GnomeGlobalShortcutBackend::kGsdService); -#else // QT_DBUS_LIB +#else return false; #endif diff --git a/src/globalshortcuts/gnomeglobalshortcutbackend.cpp b/src/globalshortcuts/gnomeglobalshortcutbackend.cpp index 3601e3889..497b3b279 100644 --- a/src/globalshortcuts/gnomeglobalshortcutbackend.cpp +++ b/src/globalshortcuts/gnomeglobalshortcutbackend.cpp @@ -20,20 +20,21 @@ #include "config.h" -#ifdef QT_DBUS_LIB -# include -# include -# include -# include -# include +#ifdef HAVE_DBUS +# include "dbus/gnomesettingsdaemon.h" #endif + #include #include #include #include -#ifdef QT_DBUS_LIB -#include "dbus/gnomesettingsdaemon.h" +#ifdef HAVE_DBUS +# include +# include +# include +# include +# include #endif #include "core/closure.h" @@ -53,7 +54,7 @@ GnomeGlobalShortcutBackend::GnomeGlobalShortcutBackend(GlobalShortcuts *parent) bool GnomeGlobalShortcutBackend::DoRegister() { -#ifdef QT_DBUS_LIB +#ifdef HAVE_DBUS qLog(Debug) << "registering"; // Check if the GSD service is available if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(kGsdService)) { @@ -71,7 +72,7 @@ bool GnomeGlobalShortcutBackend::DoRegister() { NewClosure(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(RegisterFinished(QDBusPendingCallWatcher*)), watcher); return true; -#else // QT_DBUS_LIB +#else qLog(Warning) << "dbus not available"; return false; #endif @@ -80,7 +81,7 @@ bool GnomeGlobalShortcutBackend::DoRegister() { void GnomeGlobalShortcutBackend::RegisterFinished(QDBusPendingCallWatcher *watcher) { -#ifdef QT_DBUS_LIB +#ifdef HAVE_DBUS QDBusMessage reply = watcher->reply(); watcher->deleteLater(); @@ -93,14 +94,15 @@ void GnomeGlobalShortcutBackend::RegisterFinished(QDBusPendingCallWatcher *watch is_connected_ = true; qLog(Debug) << "registered"; -#endif // QT_DBUS_LIB +#endif } void GnomeGlobalShortcutBackend::DoUnregister() { qLog(Debug) << "unregister"; -#ifdef QT_DBUS_LIB + +#ifdef HAVE_DBUS // Check if the GSD service is available if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(kGsdService)) return;