Commit 4aa762c0 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KDEPlatformSystemTrayIcon] Use generated DBus XML

Saves an introspection call

Differential Revision: https://phabricator.kde.org/D20381
parent 377895a3
......@@ -45,6 +45,8 @@ set(platformThemeSRCS
../src/platformtheme/x11integration.cpp
)
qt5_add_dbus_interface(platformThemeSRCS ../src/platformtheme/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher_interface)
frameworkintegration_tests(
kdeplatformtheme_unittest
${platformThemeSRCS}
......
......@@ -32,6 +32,8 @@ set(platformtheme_SRCS
main.cpp
)
qt5_add_dbus_interface(platformtheme_SRCS org.kde.StatusNotifierWatcher.xml statusnotifierwatcher_interface)
add_library(KDEPlasmaPlatformTheme MODULE ${platformtheme_SRCS})
target_link_libraries(KDEPlasmaPlatformTheme
......
......@@ -26,6 +26,8 @@
#include <QApplication>
#include <QDBusInterface>
#include "statusnotifierwatcher_interface.h"
SystemTrayMenu::SystemTrayMenu()
: QPlatformMenu()
, m_tag(0)
......@@ -361,9 +363,11 @@ void KDEPlatformSystemTrayIcon::showMessage(const QString &title, const QString
bool KDEPlatformSystemTrayIcon::isSystemTrayAvailable() const
{
QDBusInterface systrayHost(QStringLiteral("org.kde.StatusNotifierWatcher"), QStringLiteral("/StatusNotifierWatcher"), QStringLiteral("org.kde.StatusNotifierWatcher"));
org::kde::StatusNotifierWatcher systrayHost(QStringLiteral("org.kde.StatusNotifierWatcher"),
QStringLiteral("/StatusNotifierWatcher"),
QDBusConnection::sessionBus());
if (systrayHost.isValid()) {
return systrayHost.property("IsStatusNotifierHostRegistered").toBool();
return systrayHost.isStatusNotifierHostRegistered();
}
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment