As of Qt 5.5, Qt will automatically use Freedesktop notifications when available and relevant to the platform. There is no more need to roll our own, so remove the dbus notification code.
This change also removes any mention of the QtDbus library from the build system. We do not need to link against it explicitly anymore. I have however not removed Qt dbus flags from the depends system, because it needs to be available internally for this to work.
The feature to set a custom QIcon for notifications is also removed, as it was only available for DBUS and besides, isn’t used at all!
This change only affects Linux. Closes #573.
Known limitation
So there’s one expected case where this fails to show a notification, where the old code does. If there is no recognized tray (QSystemTrayIcon::isSystemTrayAvailable
), there is no tray icon, and no notification will be shown (as Qt’s notifications go through the tray icon).
I’m not sure this is a blocking problem. It may actually be an advantage as it avoids the problem underlying #575. It won’t try to connect to the notification service at all if there is likely no support.