[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kscreen/sebas/osd] tests/osd: call the dbus service from the test app
From:       Sebastian_Kügler <sebas () kde ! org>
Date:       2016-12-05 22:40:52
Message-ID: E1cE1wK-00034I-AL () code ! kde ! org
[Download RAW message or body]

Git commit bbf1b805eb8c5a5dbd8b533ec9626d0eabd51137 by Sebastian Kügler.
Committed on 05/12/2016 at 22:24.
Pushed by sebas into branch 'sebas/osd'.

call the dbus service from the test app

Not sure why it doesn't work yet, but it's a start.

M  +14   -2    tests/osd/osdtest.cpp

https://commits.kde.org/kscreen/bbf1b805eb8c5a5dbd8b533ec9626d0eabd51137

diff --git a/tests/osd/osdtest.cpp b/tests/osd/osdtest.cpp
index 64b55fe..b54b05e 100644
--- a/tests/osd/osdtest.cpp
+++ b/tests/osd/osdtest.cpp
@@ -20,6 +20,9 @@
 #include "../../kded/osdmanager.h"
 
 #include <QCoreApplication>
+#include <QDBusConnection>
+#include <QDBusMessage>
+#include <QDBusPendingCall>
 #include <QLoggingCategory>
 
 Q_LOGGING_CATEGORY(KSCREEN_KDED, "kscreen.kded")
@@ -40,8 +43,17 @@ void OsdTest::showOutputIdentifiers()
         QTimer::singleShot(5500, qApp, &QCoreApplication::quit);
         KScreen::OsdManager::self()->showOutputIdentifiers();
     } else {
-        qCWarning(KSCREEN_KDED) << "Implement me.";
-        QTimer::singleShot(100, qApp, &QCoreApplication::quit);
+        QDBusMessage msg = QDBusMessage::createMethodCall(
+            QLatin1Literal("org.kde.kscreen.osdService"),
+            QLatin1Literal("/org/kde/kscreen/osdService"),
+            QLatin1Literal("org.kde.kscreen.osdService"),
+            QLatin1Literal("showOutputIdentifiers")
+        );
+        //msg << icon << text;
+        QDBusConnection::sessionBus().asyncCall(msg);
+
+        qCWarning(KSCREEN_KDED) << "Sent dbus message.";
+        QTimer::singleShot(500, qApp, &QCoreApplication::quit);
     }
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic