X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=homescreen%2Fsrc%2Fmain.cpp;h=59a259ef1430d00b3bddc2aac53f4688a2f5489e;hb=9cd61f1d0361c94ee4e1bed6fd1e80151db927cd;hp=47d4f1617c8067d49fbf5cd24d68bb41b7fae917;hpb=c4f4d617bab8275a62f72d39665051cda1fe950b;p=apps%2Fhomescreen.git 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 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");