X-Git-Url: http://git.maemo.org/git/?p=vicar;a=blobdiff_plain;f=src%2Fvicar-daemon%2Fcpp%2Fcallrouter.cpp;fp=src%2Fvicar-daemon%2Fcpp%2Fcallrouter.cpp;h=0ea72cbd6ea780d9af796e35e0d5ecdfe9053e85;hp=7a5d8ed39da5411f7ae368ffee598279982eda2f;hb=2beca638f4ba146e25320c9c07cc1f29d0b2bba2;hpb=74800375ecf7f41e290cf7cc7fa9ee8b230be68e diff --git a/src/vicar-daemon/cpp/callrouter.cpp b/src/vicar-daemon/cpp/callrouter.cpp index 7a5d8ed..0ea72cb 100755 --- a/src/vicar-daemon/cpp/callrouter.cpp +++ b/src/vicar-daemon/cpp/callrouter.cpp @@ -7,7 +7,6 @@ #include "callrouter.h" #include "vicardbusadaptor.h" #include -#include #include #include #include @@ -23,13 +22,13 @@ public: databaseUtility(new DatabaseUtility(p)), dbusAdaptor(new VicarDbusAdaptor(p)), dbusUtility(new DbusUtility(p)), - gconfUtility(new GConfUtility(p)), tpUtility(new TelepathyUtility(p)), parent(p) { Q_ASSERT(0 != dbusAdaptor); //Do not open here - Unable to capture changes to DB if it is open too early and closed late. //databaseUtility->openDatabase(); + qDebug () << "In Private Constructor"; } ~CallRouterPrivate() @@ -41,7 +40,6 @@ public: DatabaseUtility *databaseUtility; VicarDbusAdaptor * dbusAdaptor; DbusUtility * dbusUtility; - GConfUtility * gconfUtility; TelepathyUtility *tpUtility; QString strLastDialedNumber; QString strLastDTMFCode; @@ -56,8 +54,7 @@ CallRouter::CallRouter(QObject *parent) : d(new CallRouterPrivate(this)) { Q_ASSERT(0 != d); - this->registerDBusService(); - qDebug() << "Vicar-Daemon: Registered DBus Service " << APPLICATION_DBUS_SERVICE; + this->registerDBusService(); } CallRouter::~CallRouter(){ @@ -70,16 +67,23 @@ void CallRouter::registerDBusService(){ if (!connection.interface()->isServiceRegistered(APPLICATION_DBUS_SERVICE)){ if (!connection.registerService(APPLICATION_DBUS_SERVICE)) { - qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage(); + qDebug() << "Vicar-Daemon: Error registering D-Bus service " << d->dbusUtility->getErrorMessage(); + qDebug() << "Vicar-Daemon: Exiting"; exit(1); } + else{ + qDebug() << "Vicar-Daemon: Registered DBus Service " << APPLICATION_DBUS_SERVICE; + } } if (!connection.registerObject(APPLICATION_DBUS_PATH, this, QDBusConnection::ExportAdaptors)) { qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage(); + qDebug() << "Vicar-Daemon: Exiting"; exit(2); } - + else{ + qDebug() << "Vicar-Daemon: Registered DBus Object " << APPLICATION_DBUS_PATH; + } } @@ -110,7 +114,10 @@ QString CallRouter::callViaCallingCard(QString strDestinationNumber){ strErrorMessage = QString("Vicar-Daemon: Error finding VICaR profile. %1").arg(d->databaseUtility->lastError().text()); } else if (d->currentProfile->profileID == 0){ - bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default"); + QString routeOnDefaultSetting = d->databaseUtility->getSetting("route_on_default"); + //bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default"); + bool routeOnDefault = routeOnDefaultSetting == "1"? true:false; + if (routeOnDefault){ qDebug() << "Vicar-Daemon: Routing directly as per configuration"; this->placeCall(strDestinationNumber);