From fdf953c98271c03f4bb6ed0f4dfeb6ad84ae26b1 Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Wed, 16 Sep 2015 12:04:33 -0400
Subject: [PATCH] dbus: assume DBus InstanceInterface instance is not valid

In most use cases the client launches the daemon via dbus on start.
Thus we expect the InstanceInterface to have an error as the
daemon is not initially present on the dbus.

Issue: #80493
Change-Id: I5b5ebab4662d5e543eae142eefb4531b09327ab1
---
 src/dbus/instancemanager.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/dbus/instancemanager.cpp b/src/dbus/instancemanager.cpp
index 88f30eb3..9ee215f7 100644
--- a/src/dbus/instancemanager.cpp
+++ b/src/dbus/instancemanager.cpp
@@ -46,11 +46,15 @@ InstanceInterface& DBus::InstanceManager::instance()
         registered = true;
         reply.waitForFinished();
     }
-    if (!interface->isValid()) {
-        GlobalInstances::dBusErrorHandler().invalidInterfaceError(
-            "Error : dring is not available, make sure it is running"
-        );
-    }
+
+    /* we do not check if the interface isValid;
+     * isValid() return 'false' if there was any error;
+     * we expect there to be an error when we first launch the client and the daemon is not yet
+     * running;
+     * TODO: check if we get the expected error, or another, see:
+     * http://doc.qt.io/qt-4.8/qdbuserror.html#ErrorType-enum
+     */
+
 #endif
     return *interface;
 }
-- 
GitLab