aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2017-05-12 21:52:20 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2017-05-12 21:52:20 +0000
commit595d010bb90d8e10971e8cff389ceff7a50288b3 (patch)
tree184ff5b9f4df77bbd1dcf7ab4a20350551c4caa0
parente61042f21f8e63b63841bcaa059ef603009904db (diff)
parent9cd61f1d0361c94ee4e1bed6fd1e80151db927cd (diff)
Merge "main: instantiate a afm_user_daemon proxy"
-rw-r--r--homescreen/src/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp
index 47d4f16..59a259e 100644
--- a/homescreen/src/main.cpp
+++ b/homescreen/src/main.cpp
@@ -27,14 +27,37 @@
#include "statusbarmodel.h"
#include "applicationmodel.h"
+#include "afm_user_daemon_proxy.h"
+
+// XXX: We want this DBus connection to be shared across the different
+// QML objects, is there another way to do this, a nice way, perhaps?
+org::AGL::afm::user *afm_user_daemon_proxy;
+
+namespace {
+
+struct Cleanup {
+ static inline void cleanup(org::AGL::afm::user *p) {
+ delete p;
+ afm_user_daemon_proxy = Q_NULLPTR;
+ }
+};
+
void noOutput(QtMsgType, const QMessageLogContext &, const QString &)
{
}
+}
+
int main(int argc, char *argv[])
{
QGuiApplication a(argc, argv);
+ QScopedPointer<org::AGL::afm::user, Cleanup> afm_user_daemon_proxy(new org::AGL::afm::user("org.AGL.afm.user",
+ "/org/AGL/afm/user",
+ QDBusConnection::sessionBus(),
+ 0));
+ ::afm_user_daemon_proxy = afm_user_daemon_proxy.data();
+
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("HomeScreen");