diff --git a/Qarma.cpp b/Qarma.cpp index 2c37d8e..006198e 100644 --- a/Qarma.cpp +++ b/Qarma.cpp @@ -25,9 +25,11 @@ #include #include #include +#ifdef DBUS_ENABLED #include #include #include +#endif #include #include #include @@ -954,6 +956,7 @@ char Qarma::showList(const QStringList &args) void Qarma::notify(const QString message, bool noClose) { +#ifdef DBUS_ENABLED if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications")) { QDBusInterface notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications"); const QString summary = (message.length() < 32) ? message : message.left(25) + "..."; @@ -985,6 +988,7 @@ void Qarma::notify(const QString message, bool noClose) SHOW_DIALOG dlg->adjustSize(); dlg->move(QGuiApplication::screens().at(0)->availableGeometry().topRight() - QPoint(dlg->width() + 20, -20)); +#endif } char Qarma::showNotification(const QStringList &args) diff --git a/qarma.pro b/qarma.pro index 8cb4d2a..c904d66 100644 --- a/qarma.pro +++ b/qarma.pro @@ -1,11 +1,16 @@ HEADERS = Qarma.h SOURCES = Qarma.cpp -QT += dbus gui widgets +QT += gui widgets lessThan(QT_MAJOR_VERSION, 6){ unix:!macx:QT += x11extras } TARGET = qarma +!DISABLE_DBUS { + DEFINES += DBUS_ENABLED + QT += dbus +} + unix:!macx:LIBS += -lX11 unix:!macx:DEFINES += WS_X11