Commit 76b112d8 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Task Manager] Reverse DBus setup order

First connect to the signal, then register the object, and only at last register the service.
Otherwise it might expose a not yet fully operational service on DBus.

Differential Revision: https://phabricator.kde.org/D9838
parent a0d8c4ff
......@@ -51,8 +51,9 @@ bool Backend::setupUnity()
{
auto sessionBus = QDBusConnection::sessionBus();
if (!sessionBus.registerService(QStringLiteral("com.canonical.Unity"))) {
qWarning() << "Failed to register unity service";
if (!sessionBus.connect({}, {}, QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"), this, SLOT(update(QString,QMap<QString,QVariant>)))) {
qWarning() << "failed to register Update signal";
return false;
}
......@@ -61,9 +62,8 @@ bool Backend::setupUnity()
return false;
}
if (!sessionBus.connect({}, {}, QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"), this, SLOT(update(QString,QMap<QString,QVariant>)))) {
qWarning() << "failed to register Update signal";
if (!sessionBus.registerService(QStringLiteral("com.canonical.Unity"))) {
qWarning() << "Failed to register unity service";
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