SIGSEGV Fixed
[vicar] / src / vicar-daemon / cpp / callrouter.cpp
index 7a5d8ed..0b95d92 100755 (executable)
@@ -7,7 +7,6 @@
 #include "callrouter.h"
 #include "vicardbusadaptor.h"
 #include <dbusutility.h>
-#include <gconfutility.h>
 #include <databaseutility.h>
 #include <telepathyutility.h>
 #include <QDebug>
@@ -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;
@@ -110,7 +108,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);