diff options
Diffstat (limited to 'sowatchd')
-rw-r--r-- | sowatchd/global.h | 11 | ||||
-rw-r--r-- | sowatchd/main.cpp | 17 | ||||
-rw-r--r-- | sowatchd/sowatchd.pro | 2 |
3 files changed, 9 insertions, 21 deletions
diff --git a/sowatchd/global.h b/sowatchd/global.h deleted file mode 100644 index 45c2b13..0000000 --- a/sowatchd/global.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef GLOBAL_H -#define GLOBAL_H - -#include "daemon.h" - -namespace sowatch -{ -extern sowatch::Daemon* daemon; -} - -#endif // GLOBAL_H diff --git a/sowatchd/main.cpp b/sowatchd/main.cpp index 1fd1789..6bd502b 100644 --- a/sowatchd/main.cpp +++ b/sowatchd/main.cpp @@ -4,14 +4,9 @@ #include <QtDBus/QDBusConnection> #include <sowatch.h> -#include "global.h" +#include "daemon.h" #include "daemonadaptor.h" -namespace sowatch -{ - Daemon* daemon; -} - using namespace sowatch; static void setupLocalization(QApplication *app) @@ -48,16 +43,20 @@ int main(int argc, char *argv[]) QApplication::setApplicationName("sowatchd"); QApplication::setQuitOnLastWindowClosed(false); + // Load translators setupLocalization(&app); - sowatch::daemon = new Daemon(&app); - new DaemonAdaptor(sowatch::daemon); + // Create the daemon object and D-Bus adaptor + Daemon daemon; + DaemonAdaptor adaptor(&daemon); + + Q_UNUSED(adaptor); QDBusConnection connection = QDBusConnection::sessionBus(); if (!connection.registerService("com.javispedro.sowatchd")) { qCritical("Could not register D-Bus service"); } - if (!connection.registerObject("/com/javispedro/sowatch/daemon", sowatch::daemon)) { + if (!connection.registerObject("/com/javispedro/sowatch/daemon", &daemon)) { qCritical("Could not register daemon object"); } diff --git a/sowatchd/sowatchd.pro b/sowatchd/sowatchd.pro index f44acdc..17176fb 100644 --- a/sowatchd/sowatchd.pro +++ b/sowatchd/sowatchd.pro @@ -6,7 +6,7 @@ QT += core gui dbus CONFIG -= app_bundle SOURCES += main.cpp daemon.cpp daemonadaptor.cpp watchhandler.cpp -HEADERS += global.h daemon.h daemonadaptor.h watchhandler.h +HEADERS += daemon.h daemonadaptor.h watchhandler.h LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch INCLUDEPATH += $$PWD/../libsowatch |