From 2f631362b54180252d0daa34f359338860a8782b Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 2 Sep 2012 20:53:05 +0200 Subject: fixing a few warnings --- sowatchd/global.h | 11 ----------- sowatchd/main.cpp | 17 ++++++++--------- sowatchd/sowatchd.pro | 2 +- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 sowatchd/global.h (limited to 'sowatchd') 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 #include -#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 -- cgit v1.2.3