Fix "error activiting kdeconnectd" for kdeconnect-cli

Summary:
Kdeconnect-cli always displayed one or more "error activating kdeconnectd: QDBusError("", "")" messages.

This diff uses the reply of starting the kdeconnect daemon correctly, so this does not happen anymore.

Test Plan: Kdeconnect-cli and the daemon still work, but kdeconnect-cli does not show the error message anymore. I verified that if, for some reason, the daemon could not start, it does display an error.

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol

Differential Revision: https://phabricator.kde.org/D9058
This commit is contained in:
Matthijs Tijink 2017-12-03 19:18:19 +01:00 committed by Nicolas Fella
parent 71bf898d46
commit 227e264042

View file

@ -22,8 +22,8 @@
QString DaemonDbusInterface::activatedService() {
static const QString service = QStringLiteral("org.kde.kdeconnect");
QDBusConnection::sessionBus().interface()->startService(service);
if (!QDBusConnection::sessionBus().interface()->isValid()) {
auto reply = QDBusConnection::sessionBus().interface()->startService(service);
if (!reply.isValid()) {
qWarning() << "error activating kdeconnectd:" << QDBusConnection::sessionBus().interface()->lastError();
}
return service;