logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://anongit.hacktivis.me/git/overlay.git/

1.1.0-0001-Make-DBus-optionnal.patch (1908B)


  1. From 984683b6c0639f51040b4ad238183cd2b0e95776 Mon Sep 17 00:00:00 2001
  2. From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
  3. Date: Sat, 13 Jun 2020 06:49:18 +0200
  4. Subject: [PATCH 1/2] Make DBus optionnal
  5. ---
  6. Qarma.cpp | 4 ++++
  7. qarma.pro | 7 ++++++-
  8. 2 files changed, 10 insertions(+), 1 deletion(-)
  9. diff --git a/Qarma.cpp b/Qarma.cpp
  10. index bc746f8..69e5b20 100644
  11. --- a/Qarma.cpp
  12. +++ b/Qarma.cpp
  13. @@ -26,9 +26,11 @@
  14. #include <QComboBox>
  15. #include <QCryptographicHash>
  16. #include <QDate>
  17. +#ifdef DBUS_ENABLED
  18. #include <QDBusConnection>
  19. #include <QDBusConnectionInterface>
  20. #include <QDBusInterface>
  21. +#endif
  22. #include <QDialogButtonBox>
  23. #include <QEvent>
  24. #include <QFileDialog>
  25. @@ -1150,6 +1152,7 @@ char Qarma::showList(const QStringList &args)
  26. void Qarma::notify(const QString message, bool noClose)
  27. {
  28. +#ifdef DBUS_ENABLED
  29. if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications")) {
  30. QDBusInterface notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
  31. const QString summary = (message.length() < 32) ? message : message.left(25) + "...";
  32. @@ -1181,6 +1184,7 @@ void Qarma::notify(const QString message, bool noClose)
  33. SHOW_DIALOG
  34. dlg->adjustSize();
  35. dlg->move(QGuiApplication::screens().at(0)->availableGeometry().topRight() - QPoint(dlg->width() + 20, -20));
  36. +#endif
  37. }
  38. char Qarma::showNotification(const QStringList &args)
  39. diff --git a/qarma.pro b/qarma.pro
  40. index 8cb4d2a..c904d66 100644
  41. --- a/qarma.pro
  42. +++ b/qarma.pro
  43. @@ -1,11 +1,16 @@
  44. HEADERS = Qarma.h
  45. SOURCES = Qarma.cpp
  46. -QT += dbus gui widgets
  47. +QT += gui widgets
  48. lessThan(QT_MAJOR_VERSION, 6){
  49. unix:!macx:QT += x11extras
  50. }
  51. TARGET = qarma
  52. +!DISABLE_DBUS {
  53. + DEFINES += DBUS_ENABLED
  54. + QT += dbus
  55. +}
  56. +
  57. unix:!macx:LIBS += -lX11
  58. unix:!macx:DEFINES += WS_X11
  59. --
  60. 2.52.0