Merge branch 'master' of ssh://drop.maemo.org/git/vicar
authorSudheer K <scifi1947 at gmail.com>
Sat, 14 Jan 2012 06:11:07 +0000 (22:11 -0800)
committerSudheer K <scifi1947 at gmail.com>
Sat, 14 Jan 2012 06:11:07 +0000 (22:11 -0800)
Conflicts:
qtc_packaging/debian_harmattan/prerm
qtc_packaging/debian_harmattan/rules
qtc_packaging/debian_harmattan/vicar.aegis
qtc_packaging/debian_harmattan/vicar.substvars
src/data/accounts/vicar.service
src/vicar-config-qml/qml/vicarconfigqml/Library/js/DBUtility.js
src/vicar-daemon/vicar-daemon.pro
src/vicar-lib/cpp/gconfutility.cpp
src/vicar-lib/cpp/gconfutility.h
src/vicar-lib/cpp/logutility.h
src/vicar-lib/cpp/telepathyutility.cpp
src/vicar-lib/vicar-lib.pro
src/vicar-telepathy/cpp/connection.cpp
src/vicar-telepathy/cpp/connectioninterfacerequestsadaptor.cpp
src/vicar-telepathy/cpp/connectionmanager.cpp
src/vicar-telepathy/cpp/main.cpp
src/vicar-telepathy/vicar-telepathy.pro
src/vicar-utils/cpp/main.cpp

23 files changed:
qtc_packaging/debian_harmattan/manifest.aegis_old [new file with mode: 0644]
qtc_packaging/debian_harmattan/postinst_DONTUSE [new file with mode: 0644]
qtc_packaging/debian_harmattan/postrm [new file with mode: 0755]
qtc_packaging/debian_harmattan/prerm
qtc_packaging/debian_harmattan/rules
qtc_packaging/debian_harmattan/vicar.aegis
qtc_packaging/debian_harmattan/vicar.substvars
src/data/accounts/vicar.service
src/data/xml/org.sip.connection.properties [new file with mode: 0644]
src/vicar-config-qml/qml/vicarconfigqml/Library/js/DBUtility.js
src/vicar-daemon/cpp/callrouter.cpp
src/vicar-daemon/vicar-daemon.pro
src/vicar-lib/cpp/gconfutility.cpp [new file with mode: 0755]
src/vicar-lib/cpp/gconfutility.h [new file with mode: 0755]
src/vicar-lib/cpp/logutility.h
src/vicar-lib/cpp/telepathyutility.cpp
src/vicar-lib/vicar-lib.pro
src/vicar-telepathy/cpp/connection.cpp
src/vicar-telepathy/cpp/connectioninterfacerequestsadaptor.cpp
src/vicar-telepathy/cpp/connectionmanager.cpp
src/vicar-telepathy/vicar-telepathy.pro
src/vicar-utils/cpp/main.cpp
welcome [deleted file]

diff --git a/qtc_packaging/debian_harmattan/manifest.aegis_old b/qtc_packaging/debian_harmattan/manifest.aegis_old
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/qtc_packaging/debian_harmattan/postinst_DONTUSE b/qtc_packaging/debian_harmattan/postinst_DONTUSE
new file mode 100644 (file)
index 0000000..e608d4c
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+# postinst script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+
+       eval $(dbus-launch --sh-syntax)
+       export DBUS_SESSION_BUS_ADDRESS
+       export DBUS_SESSION_BUS_PID
+
+       # Kill any running instances of the daemon (only used on Linux based systems)
+       #killall -q vicar-daemon || true
+       #killall -q vicar-telepathy || true
+
+       echo "Checking for log folder ..."
+        [[ ! -d /var/log/vicar ]] && mkdir /var/log/vicar
+
+       echo "Checking for log file ..."
+        [[ ! -e /var/log/vicar/vicar.log ]] && touch /var/log/vicar/vicar.log && chown -R user:users /var/log/vicar
+
+        echo "Starting Vicar daemon ..."
+        #[[ -x /opt/vicar/bin/vicar-daemon ]] && su - user -c "exec /opt/vicar/bin/vicar-daemon& >/dev/null"
+
+        echo "Starting Vicar-Telepathy ..."
+        #[[ -x /opt/vicar/bin/vicar-telepathy ]] && su - user -c "exec /opt/vicar/bin/vicar-telepathy& >/dev/null"
+
+        echo "Creating Vicar Telepathy account ..."
+        #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils INSTALL"
+
+        echo "Updating permissions on Vicar DB file ..."
+        #[[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite
+
+        echo "Creating Vicar Profiles database ..."
+        #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils CREATEDB"
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/qtc_packaging/debian_harmattan/postrm b/qtc_packaging/debian_harmattan/postrm
new file mode 100755 (executable)
index 0000000..715c06a
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# postrm script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+        echo "Removing logs ..."
+        #[[ -d /var/log/vicar ]] && rm -rf /var/log/vicar
+    ;;
+
+    remove|abort-install)
+    ;;
+
+    upgrade|failed-upgrade|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
index e650ab5..d4b71f2 100755 (executable)
@@ -20,6 +20,7 @@ set -e
 case "$1" in
     remove|deconfigure)
 
+<<<<<<< HEAD
         echo "Deleting Vicar Telepathy account ..."
         [[ -x /opt/vicar/bin/vicar-utils ]] && /opt/vicar/bin/vicar-utils REMOVE
 
@@ -28,6 +29,17 @@ case "$1" in
 
         #echo "Deleting Vicar Profiles database ..."
         #[[ -d /home/user/.vicar ]] && rm -rf /home/user/.vicar/
+=======
+       eval $(dbus-launch --sh-syntax)
+       export DBUS_SESSION_BUS_ADDRESS
+       export DBUS_SESSION_BUS_PID
+
+        echo "Deleting Vicar Telepathy account ..."
+        #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils REMOVE"
+
+        echo "Deleting Vicar Profiles database ..."
+        #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils DROPDB"
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
        # Kill any running instances of the daemon (only used on Linux based systems)
        killall -q vicar-daemon || true
index 3273a26..eeb9a8b 100755 (executable)
@@ -62,7 +62,11 @@ binary-arch: build install
        dh_testroot
        dh_installchangelogs 
        dh_installdocs
+<<<<<<< HEAD
 #      dh_installexamples
+=======
+       dh_installexamples
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 #      dh_install
 #      dh_installmenu
 #      dh_installdebconf       
@@ -74,15 +78,25 @@ binary-arch: build install
 #      dh_installinit
 #      dh_installcron
 #      dh_installinfo
+<<<<<<< HEAD
 #      dh_installman
        dh_link
        dh_strip #Uncomment to remove debug symbols
+=======
+       dh_installman
+       dh_link
+       dh_strip
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
        dh_compress
        dh_fixperms
 #      dh_perl
 #      dh_makeshlibs
        dh_installdeb
+<<<<<<< HEAD
        dh_shlibdeps # Uncomment this line for use without Qt Creator
+=======
+       # dh_shlibdeps # Uncomment this line for use without Qt Creator
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
        dh_gencontrol
        dh_md5sums
        dh_builddeb
index 4c310f9..4062f81 100644 (file)
@@ -8,7 +8,11 @@
      Modify the file or remove the checksum to disable this functionality. -->
 <aegis>
 
+<<<<<<< HEAD
         <!--provide>
+=======
+        <!-- provide>
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
            <dbus name="org.freedesktop.Telepathy.Connection.vicar.tel.vicar" own="Cellular" bus="session">
                <node name="/">
                        <interface name="org.freedesktop.Telepathy.Connection">
                <for path="/opt/vicar/bin/vicar-telepathy" />
                <for path="/opt/vicar/bin/vicar-daemon" />
                <for path="/opt/vicar/bin/vicar-utils" />
+<<<<<<< HEAD
+=======
+               <!-- These entries to be used only when debug package is included
+               <for path="/usr/lib/debug/opt/vicar/bin/vicar-telepathy" />
+               <for path="/usr/lib/debug/opt/vicar/bin/vicar-daemon" />
+               <for path="/usr/lib/debug/opt/vicar/bin/vicar-utils" /> -->
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
        </request>
 
        <request context="INSTALL">
index 218df44..d264d1f 100644 (file)
@@ -1,2 +1,5 @@
+<<<<<<< HEAD
 shlibs:Depends=applauncherd-launcher, libaccounts-qt1, libc6 (>= 2.4), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libgcc1 (>= 1:4.1.1), libgconf2-6 (>= 2.13.5), libglib2.0-0 (>= 2.12.0), libqt4-dbus (>= 4.7.4~git20110517), libqt4-declarative (>= 4.7.4~git20110517), libqt4-sql (>= 4.7.4~git20110517), libqt4-xml (>= 4.7.4~git20110517), libqtcore4 (>= 4.7.4~git20110517), libqtgui4 (>= 4.7.4~git20110517), libstdc++6 (>= 4.4.0)
+=======
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 misc:Depends=
index 13a981d..85bd555 100644 (file)
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <service id="vicar">
   <type>IM</type>
+<<<<<<< HEAD
   <name>Vicar</name>
+=======
+  <name>VICaR Service Name</name>
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
   <provider>vicar</provider>
   <icon>icon-m-service-vicar</icon>
 
diff --git a/src/data/xml/org.sip.connection.properties b/src/data/xml/org.sip.connection.properties
new file mode 100644 (file)
index 0000000..b628aae
--- /dev/null
@@ -0,0 +1,24 @@
+   array [
+      dict entry(
+         string "HasImmortalHandles"
+         variant             boolean true
+      )
+      dict entry(
+         string "Status"
+         variant             uint32 0
+      )
+      dict entry(
+         string "SelfHandle"
+         variant             uint32 1
+      )
+      dict entry(
+         string "Interfaces"
+         variant             array [
+               string "org.freedesktop.Telepathy.Connection.Interface.Requests"
+               string "org.freedesktop.Telepathy.Connection.Interface.Contacts"
+               string "org.freedesktop.Telepathy.Connection.Interface.Aliasing"
+            ]
+      )
+   ]
+
+type=MethodReturn, service=":1.16", signature="a{sv}", contents=([Argument: a{sv} {"HasImmortalHandles" = [Variant(bool): true], "Status" = [Variant(uint): 0], "SelfHandle" = [Variant(uint): 1], "Interfaces" = [Variant(QStringList): {"org.freedesktop.Telepathy.Connection.Interface.Requests", "org.freedesktop.Telepathy.Connection.Interface.Contacts", "org.freedesktop.Telepathy.Connection.Interface.Capabilities", "org.freedesktop.Telepathy.Connection.Interface.ServicePoint", "org.freedesktop.Telepathy.Connection.Interface.Cellular", "org.freedesktop.Telepathy.Connection.Interface.Anonymity", "com.nokia.Telepathy.Connection.Interface.StoredMessages"}]}]) 
index f5b1fe3..df5c276 100644 (file)
@@ -26,7 +26,11 @@ function initialize() {
             // Create the settings table if it doesn't already exist
             // If the table exists, this is skipped
             tx.executeSql('CREATE TABLE IF NOT EXISTS settings(setting TEXT PRIMARY KEY, value TEXT)');
+<<<<<<< HEAD
             tx.executeSql('CREATE TABLE IF NOT EXISTS profiles(id INTEGER PRIMARY KEY, numberpattern TEXT, gatewaynumber TEXT, dtmfformat TEXT, dtmfprefix TEXT, dtmfsuffix TEXT)');
+=======
+            tx.executeSql('CREATE TABLE IF NOT EXISTS rules(id INTEGER PRIMARY KEY, numberpattern TEXT, gatewaynumber TEXT, dtmfformat TEXT, dtmfprefix TEXT, dtmfsuffix TEXT)');
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
           },
         function(error) {
             logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
@@ -75,13 +79,21 @@ function setSetting(setting, value) {
 }
 
 function addRule(ruleObj){
+<<<<<<< HEAD
     logMessage('SQL> INSERT INTO profiles(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, '+[ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]+')');
+=======
+    logMessage('SQL> INSERT INTO rules(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, '+[ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]+')');
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     var db = getDatabase();
     var res = "";
     logMessage("Opened VICaR database..");
 
     db.transaction(function(tx) {
+<<<<<<< HEAD
                var rs = tx.executeSql('INSERT INTO profiles(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, ?, ?, ?, ?, ?);', [ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]);
+=======
+               var rs = tx.executeSql('INSERT INTO rules(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, ?, ?, ?, ?, ?);', [ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
                logMessage("Inserted "+rs.rowsAffected+" rows");
                if (rs.rowsAffected > 0) {
                  res = "OK";
@@ -97,7 +109,11 @@ function addRule(ruleObj){
 }
 
 function updateRule(id,ruleObj){
+<<<<<<< HEAD
     logMessage('SQL> UPDATE profiles set numberpattern = '+[ruleObj.numberpattern]+
+=======
+    logMessage('SQL> UPDATE rules set numberpattern = '+[ruleObj.numberpattern]+
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
                ', gatewaynumber = '+[ruleObj.gatewaynumber]+
                ', dtmfformat = '+[ruleObj.dtmfformat]+
                ', dtmfprefix = '+[ruleObj.dtmfprefix]+
@@ -106,7 +122,11 @@ function updateRule(id,ruleObj){
     var db = getDatabase();
     var res = "";
     db.transaction(function(tx) {
+<<<<<<< HEAD
            var rs = tx.executeSql('UPDATE profiles set numberpattern = ?, gatewaynumber = ?, dtmfformat = ?, dtmfprefix = ?, dtmfsuffix = ? WHERE id = ?;',
+=======
+           var rs = tx.executeSql('UPDATE rules set numberpattern = ?, gatewaynumber = ?, dtmfformat = ?, dtmfprefix = ?, dtmfsuffix = ? WHERE id = ?;',
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
                             [ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix, id]);
            logMessage("Updated "+rs.rowsAffected+" rows");
            if (rs.rowsAffected > 0) {
@@ -123,11 +143,19 @@ function updateRule(id,ruleObj){
 }
 
 function removeRule(id){
+<<<<<<< HEAD
     logMessage('SQL> DELETE FROM profiles WHERE id = '+[id]);
     var db = getDatabase();
     var res = "";
     db.transaction(function(tx) {
          var rs = tx.executeSql('DELETE FROM profiles WHERE id = ?;', [id]);
+=======
+    logMessage('SQL> DELETE FROM rules WHERE id = '+[id]);
+    var db = getDatabase();
+    var res = "";
+    db.transaction(function(tx) {
+         var rs = tx.executeSql('DELETE FROM rules WHERE id = ?;', [id]);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
                logMessage("Deleted "+rs.rowsAffected+" rows");
                if (rs.rowsAffected > 0) {
                  res = "OK";
@@ -147,7 +175,11 @@ function getAllRules(){
     var rulesArray = new Array();
     var ruleObj;
     db.transaction(function(tx) {
+<<<<<<< HEAD
            var rs = tx.executeSql('SELECT * FROM profiles');
+=======
+           var rs = tx.executeSql('SELECT * FROM rules');
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
            logMessage("Fetched "+rs.rows.length+" rows");
            var i = 0;
            for (i = 0; i < rs.rows.length; i++){
@@ -179,8 +211,13 @@ function getRuleByID(id){
     var db = getDatabase();
     var ruleObj;
     db.transaction(function(tx) {
+<<<<<<< HEAD
            logMessage('SQL> SELECT * FROM profiles WHERE id = '+[id]);
            var rs = tx.executeSql('SELECT * FROM profiles WHERE id = '+[id]);
+=======
+           logMessage('SQL> SELECT * FROM rules WHERE id = '+[id]);
+           var rs = tx.executeSql('SELECT * FROM rules WHERE id = '+[id]);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
            logMessage("Fetched "+rs.rows.length+" rows");
            if (rs.rows.length > 0){
                ruleObj = new Object();
index 0b95d92..0ea72cb 100755 (executable)
@@ -54,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(){
@@ -68,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;
+    }
 }
 
 
index f7134d9..9ac1d4a 100755 (executable)
@@ -16,11 +16,21 @@ QT += dbus sql
 QT -= gui
 TEMPLATE = app
 TARGET = vicar-daemon
+<<<<<<< HEAD
 
 VPATH += cpp
 MOC_DIR = cpp/.mocs
 OBJECTS_DIR = cpp/.objs
 
+=======
+CONFIG += console
+CONFIG -= app_bundle
+
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
+
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 SOURCES += cpp/main.cpp \
     cpp/callrouter.cpp \
     cpp/vicardbusadaptor.cpp
diff --git a/src/vicar-lib/cpp/gconfutility.cpp b/src/vicar-lib/cpp/gconfutility.cpp
new file mode 100755 (executable)
index 0000000..231a716
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "gconfutility.h"
+#include <gconf/gconf-client.h>
+#include <QDebug>
+
+GConfUtility::GConfUtility(QObject *parent) :
+    QObject(parent)
+{
+    /* Get a GConf client */
+    gconfClient = gconf_client_get_default();
+    g_assert(GCONF_IS_CLIENT(gconfClient));
+}
+
+GConfUtility::~GConfUtility(){
+    /* release GConf client */
+    g_object_unref(gconfClient);
+    gconfClient = 0;
+}
+
+QString GConfUtility::getGconfValueString(QString strKey){
+
+    char* strValue = NULL;
+
+    if (!strKey.isEmpty()) {
+        strKey.prepend(GCONF_DIR);
+
+        strValue = gconf_client_get_string(gconfClient, strKey.toAscii().constData(), NULL);
+        qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<strValue;
+    }
+
+    return QString(strValue);
+}
+
+void GConfUtility::setGconfValueString(QString strKey,QString strValue){
+
+    if (!strKey.isEmpty()){
+
+        strKey.prepend(GCONF_DIR);
+
+        if (!strValue.isEmpty()){
+                gconf_client_set_string(gconfClient, strKey.toAscii().constData(), strValue.toAscii().constData(),NULL);
+                qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<strValue.toAscii().constData();
+        }
+        else{
+                gconf_client_unset(gconfClient, strKey.toAscii().constData(),NULL);
+                qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to NULL";
+        }
+
+    }
+}
+
+bool GConfUtility::getGconfValueBoolean(QString strKey){
+
+    bool boolValue = false;
+
+    if (!strKey.isEmpty()) {
+        strKey.prepend(GCONF_DIR);
+
+        boolValue = gconf_client_get_bool(gconfClient, strKey.toAscii().constData(), NULL);
+        qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<boolValue;
+    }
+
+    return boolValue;
+}
+
+void GConfUtility::setGconfValueBoolean(QString strKey,bool boolValue){
+
+    if (!strKey.isEmpty()){
+
+        strKey.prepend(GCONF_DIR);
+
+        gconf_client_set_bool(gconfClient, strKey.toAscii().constData(),boolValue,NULL);
+        qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<boolValue;
+    }
+}
+
+int GConfUtility::getGconfValueInteger(QString strKey){
+
+    int intValue = 0;
+
+    if (!strKey.isEmpty()) {
+        strKey.prepend(GCONF_DIR);
+
+        intValue = gconf_client_get_int(gconfClient, strKey.toAscii().constData(), NULL);
+        qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<intValue;
+    }
+
+    return intValue;
+}
+
+void GConfUtility::setGconfValueInteger(QString strKey,int intValue){
+
+    if (!strKey.isEmpty()){
+
+        strKey.prepend(GCONF_DIR);
+
+        gconf_client_set_int(gconfClient, strKey.toAscii().constData(),intValue,NULL);
+        qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<intValue;
+    }
+}
diff --git a/src/vicar-lib/cpp/gconfutility.h b/src/vicar-lib/cpp/gconfutility.h
new file mode 100755 (executable)
index 0000000..8106833
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef GCONFUTILITY_H
+#define GCONFUTILITY_H
+
+#include <QObject>
+#include <gconf/gconf-client.h>
+
+#define APPLICATION_NAME "vicar"
+#define GCONF_DIR "/apps/Maemo/" APPLICATION_NAME "/"
+
+class GConfUtility : public QObject
+ {
+Q_OBJECT
+public:
+    GConfUtility(QObject *parent = 0);
+    ~GConfUtility();
+    void setGconfValueString(QString strKey,QString strValue);
+    QString getGconfValueString(QString strKey);
+
+    void setGconfValueBoolean(QString strKey,bool boolValue);
+    bool getGconfValueBoolean(QString strKey);
+
+    void setGconfValueInteger(QString strKey,int intValue);
+    int getGconfValueInteger(QString strKey);
+
+private:
+     GConfClient *gconfClient;
+};
+
+#endif // GCONFUTILITY_H
index 5d1c255..6c89c78 100644 (file)
@@ -1,21 +1,34 @@
 /*
+<<<<<<< HEAD
 @version: 0.4
+=======
+@version: 0.6
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
 
 #ifndef LOGUTILITY_H
 #define LOGUTILITY_H
+<<<<<<< HEAD
 #include <QDebug>
 #include <QFile>
 #include <QIODevice>
 #include <QDateTime>
 #include <QDir>
+=======
+#include <QFile>
+#include <QIODevice>
+#include <QTextStream>
+#include <QDateTime>
+#include <QDebug>
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
 class LogUtility : public QObject
 {
     Q_OBJECT
 
+<<<<<<< HEAD
 private:
     QFile * logFile;
 
@@ -66,6 +79,43 @@ public slots:
             qDebug() <<  "ERROROPENINGLOGFILE" << QString("Vicar: [%1] - %2").arg(strTimeNow,strMessage);
         }
     }
+=======
+public:
+    LogUtility(QString logPath,QObject *parent = 0) :
+        QObject(parent){
+        logFilePath = logPath;
+    }
+
+    ~LogUtility(){
+    }
+
+public slots:
+    void logMessage(QString strMessage, bool appendMode = true) {
+
+        QFile logFile(logFilePath);
+
+        bool success = false;
+
+        if (appendMode){
+            success = logFile.open(QIODevice::Append | QIODevice::WriteOnly | QIODevice::Text);
+        }
+        else{
+            success = logFile.open(QIODevice::Truncate | QIODevice::WriteOnly | QIODevice::Text);
+        }
+
+        QString strTimeNow = QDateTime::currentDateTime().toString("dd-MMM-yyyy HH:mm:ss");
+        if (success) {
+            QTextStream logStream(&logFile);
+            logStream <<  strTimeNow << " - " << strMessage << endl;
+        }
+        else{
+            qDebug() <<  "ERROROPENINGLOGFILE" << " - " << strMessage;
+        }
+    }
+
+private:
+    QString logFilePath;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 };
 
 #endif // LOGUTILITY_H
index 5290910..216e213 100644 (file)
@@ -151,13 +151,21 @@ bool TelepathyUtility::createAccount(){
     accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Enabled",true);
     accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.ConnectAutomatically",true);
     accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.RequestedPresence",QVariant::fromValue(presence));
+<<<<<<< HEAD
     //accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Service","vicar"); //Required when service can't be determined by the protocol name
+=======
+    accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Service","vicar"); //Required when service can't be determined by the protocol name
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.Profile","vicar");
 
     QStringList valuesList;
     valuesList.append("TEL");
     accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.SecondaryVCardFields",valuesList);
 
+    //QStringList uriSchemeList;
+    //uriSchemeList.append("tel");
+    //accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Interface.Addressing.DRAFT.URISchemes",uriSchemeList);
+
     QDBusPendingReply<QDBusObjectPath> reply = amProxy->CreateAccount("vicar","tel","Vicar",connectionParametersMap,accountPropertiesMap);
     reply.waitForFinished();
 
index d799730..f473289 100755 (executable)
@@ -19,6 +19,10 @@ OBJECTS_DIR = cpp/.objs
 DESTDIR = ../lib
 
 SOURCES += cpp/dbusutility.cpp \
+<<<<<<< HEAD
+=======
+    cpp/gconfutility.cpp \
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     cpp/telepathyutility.cpp \
     cpp/accountmanagerproxy.cpp \
     cpp/accountproxy.cpp \
@@ -28,6 +32,10 @@ SOURCES += cpp/dbusutility.cpp \
     cpp/databaseutility.cpp \
     cpp/harmattanaccountutility.cpp
 HEADERS += cpp/dbusutility.h \
+<<<<<<< HEAD
+=======
+    cpp/gconfutility.h \
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     cpp/telepathyutility.h \
     cpp/accountmanagerproxy.h \
     cpp/accountproxy.h \
index 3f71330..a197955 100644 (file)
@@ -66,7 +66,11 @@ public:
         connection_status(Connection::Disconnected),
         adaptor(new ConnectionAdaptor(p)),
         connIfaceReqsAdaptor(new ConnectionInterfaceRequestsAdaptor(p)),
+<<<<<<< HEAD
         logUtility(new LogUtility(p)),
+=======
+        logUtility(new LogUtility("/var/log/vicar/vicar.log",p)),
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         parent(p)
     {
         Q_ASSERT(0 != adaptor);
@@ -96,6 +100,10 @@ Connection::Connection(const QString & account,
 
     QString strMessage;
     strMessage = "DEBUG: In Connection Constructor";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     Q_ASSERT(0 != d);
@@ -118,6 +126,7 @@ Connection::Connection(const QString & account,
     this->setProperty("HasImmortalHandles",true);
 
     this->setProperty("Status",org::freedesktop::Telepathy::CONNECTION_STATUS_CONNECTED);
+<<<<<<< HEAD
 
 
     //this->setProperty("SelfHandle",org::freedesktop::Telepathy::HANDLE_TYPE_CONTACT);
@@ -127,6 +136,9 @@ Connection::Connection(const QString & account,
     strMessage = "VICaR Connection: Emitting SelfHandleChanged.";
     d->logUtility->logMessage(strMessage);
     emit SelfHandleChanged(selfHandle);
+=======
+    this->setProperty("SelfHandle",org::freedesktop::Telepathy::HANDLE_TYPE_CONTACT);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
     //Set the property RequestableChannelClasses
     org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses;
@@ -158,6 +170,12 @@ Connection::Connection(const QString & account,
     //Set the property Channels
     org::freedesktop::Telepathy::ChannelDetailsList channelDetails;
     this->setProperty("Channels",QVariant::fromValue(channelDetails));
+<<<<<<< HEAD
+=======
+
+    //Set the connection status to Connected (default for Vicar)
+    d->connection_status = Connection::Connected;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
     //Set the connection status to Connected (default for Vicar)
     d->connection_status = Connection::Connected;
@@ -165,6 +183,12 @@ Connection::Connection(const QString & account,
 
     strMessage = "VICaR Connection: Connection set up.";
 
+<<<<<<< HEAD
+=======
+    strMessage = "VICaR Connection: Connection set up.";
+
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 }
 
@@ -182,6 +206,10 @@ bool Connection::registerObject()
         if (!QDBusConnection::sessionBus().registerService(serviceName()))
         {
             strMessage = "VICaR Connection: Problem registering connection service:" + serviceName();
+<<<<<<< HEAD
+=======
+            qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
             d->logUtility->logMessage(strMessage);
             return false;
         }
@@ -190,12 +218,20 @@ bool Connection::registerObject()
                                                           this))
         {
             strMessage = "VICaR Connection: Problem registering object path:" + objectPath().path();
+<<<<<<< HEAD
+=======
+            qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
             d->logUtility->logMessage(strMessage);
             return false;
         }
     }
     else{
         strMessage = "VICaR Connection: " + serviceName()+" is already registered on DBus";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
     }
     return true;
@@ -204,6 +240,10 @@ bool Connection::registerObject()
 void Connection::unregisterObject()
 {
     QString strMessage = "VICaR Connection: Unregistering Connection object from DBus";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     QDBusConnection::sessionBus().unregisterObject(objectPath().path());
     QDBusConnection::sessionBus().unregisterService(serviceName());
@@ -230,11 +270,19 @@ void Connection::Connect()
        I am not connecting to anything.
      */
     QString strMessage = "VICaR Connection: Changing status to Connected...";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     d->connection_status = Connection::Connected;
 
     //Let all the Telepathy clients know that connection status has changed
     strMessage = "VICaR Connection: Emitting StatusChanged.";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     emit StatusChanged(d->connection_status, ReasonRequested);
 }
@@ -242,11 +290,19 @@ void Connection::Connect()
 void Connection::Disconnect()
 {
     QString strMessage = "VICaR Connection: Changing status to Disconnected...";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     //We don't have any Handles to release here. So just change the status to Disconnected
     d->connection_status = Connection::Disconnected;
 
     strMessage = "VICaR Connection: Emitting StatusChanged";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     emit StatusChanged(d->connection_status, ReasonRequested);
 
@@ -289,19 +345,33 @@ uint Connection::GetStatus()
 uint Connection::GetSelfHandle()
 {
     QString strMessage = "VICaR Connection: GetSelfHandle";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     if (d->connection_status != Connected)
     {
         sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
                        "VICaR - Unable to get Self Handle. The connection is no longer available.");
         strMessage = "VICaR Connection: NOT CONNECTED when requesting selfhandle!";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
         return 0;
     }
 
     //WARNING: Incomplete implemenation
+<<<<<<< HEAD
     uint handle(SELF_HANDLE);
     strMessage = "VICaR Connection: Returning Handle " + QString::number(handle) + "as self handle.";
+=======
+    uint handle = 0;
+    strMessage = "VICaR Connection: Returning Handle " + QString(handle) + "as self handle.";
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     return handle;
 }
@@ -338,11 +408,19 @@ void Connection::HoldHandles(const uint handle_type, const QList<uint> &handles)
 {
     Q_UNUSED(handles);
     QString strMessage = "VICaR Connection: HoldHandles.";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     if (d->connection_status != Connected)
     {
 
         strMessage = "VICaR Connection: HoldHandles - Not Connected.";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
 
         sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
@@ -353,6 +431,10 @@ void Connection::HoldHandles(const uint handle_type, const QList<uint> &handles)
     {
 
         strMessage = "VICaR Connection: HoldHandles - Invalid Handle Type.";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
 
         sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
@@ -368,6 +450,13 @@ QStringList Connection::InspectHandles(const uint handle_type,
 {
     Q_UNUSED(handles);
     QStringList handlesList;
+<<<<<<< HEAD
+=======
+
+    QString strMessage = "VICaR Connection: InspectHandles.";
+    qDebug() << strMessage;
+    d->logUtility->logMessage(strMessage);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
     QString strMessage = "VICaR Connection: InspectHandles.";
     //d->logUtility->logMessage(strMessage);
@@ -384,6 +473,18 @@ QStringList Connection::InspectHandles(const uint handle_type,
         sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
                        "VICaR - Supports handles of type Contact only.");
         return handlesList;
+<<<<<<< HEAD
+=======
+    }
+
+    uint handle = 0;
+    for (int i = 0 ; i < handles.length(); i++) {
+        handle = handles.at(i);
+        strMessage = "VICaR Connection: Inspecting handle "+QString(handle);
+        qDebug() << strMessage;
+        d->logUtility->logMessage(strMessage);
+        handlesList.append(QString(handle));
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     }
 
     uint handle;
@@ -406,14 +507,22 @@ QStringList Connection::InspectHandles(const uint handle_type,
 void Connection::ReleaseHandles(const uint handle_type, const QList<uint> &handles)
 {
     Q_UNUSED(handles);
+<<<<<<< HEAD
     QString strMessage = "VICaR Connection: ReleaseHandles.";
     d->logUtility->logMessage(strMessage);
 
+=======
+    QString strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     if (d->connection_status != Connected)
     {
         sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
                        "VICaR - Unable to release handle. The connection is no longer available.");
         strMessage = "VICaR Connection: Releasing Handle while connection is no longer connected.";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
         return;
     }
@@ -422,6 +531,10 @@ void Connection::ReleaseHandles(const uint handle_type, const QList<uint> &handl
         sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
                        "VICaR - Supports handles of type Contact only.");
         strMessage =  "VICaR Connection: Trying to release a Handle that is not a contact.";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
         return;
     }
@@ -497,6 +610,10 @@ QDBusObjectPath Connection::CreateChannel(const QVariantMap &request,
     Q_ASSERT(!request.isEmpty());
     QString strMessage;
     strMessage = "VICaR Connection: CreateChannel";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     qDebug() << " Request details are: "<< request;
 
@@ -515,6 +632,10 @@ bool Connection::EnsureChannel(const QVariantMap &request,
     Q_UNUSED(channel_properties);
     Q_ASSERT(!request.isEmpty());
     QString strMessage = "VICaR Connection: EnsureChannel";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     qDebug() << " Request details are: "<< request;
 
@@ -527,6 +648,10 @@ bool Connection::EnsureChannel(const QVariantMap &request,
 QDBusObjectPath Connection::processChannel(const QVariantMap &request){
 
     QString strMessage = "VICaR Connection: ProcessChannel";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     QDBusObjectPath channel_path;
@@ -590,6 +715,10 @@ QDBusObjectPath Connection::processChannel(const QVariantMap &request){
 
     strMessage = "VICaR Connection: Call is processed.";
 
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     return channel_path;
@@ -602,6 +731,10 @@ void Connection::AddClientInterest(const QStringList &tokens){
     QString strMessage;
 
     strMessage = "VICaR Connection: AddClientInterest";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 }
 
@@ -611,6 +744,10 @@ void Connection::RemoveClientInterest(const QStringList &tokens){
     QString strMessage;
 
     strMessage = "VICaR Connection: RemoveClientInterest";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 }
 
index e463ad9..a664283 100644 (file)
@@ -9,8 +9,6 @@
  */
 
 #include "connectioninterfacerequestsadaptor.h"
-#include "connectioninterfacerequeststypes.h"
-#include "connection.h"
 #include <QtCore/QMetaObject>
 #include <QtCore/QByteArray>
 #include <QtCore/QList>
@@ -51,14 +49,22 @@ org::freedesktop::Telepathy::RequestableChannelClassList ConnectionInterfaceRequ
 QDBusObjectPath ConnectionInterfaceRequestsAdaptor::CreateChannel(const QVariantMap &request, QVariantMap &channel_properties)
 {
     // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.CreateChannel
+<<<<<<< HEAD
     //This method should return a Channel object path
     return static_cast<Connection *>(parent())->CreateChannel(request, channel_properties);
+=======
+    //return static_cast<YourObjectType *>(parent())->CreateChannel(request, channel_properties);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 }
 
 bool ConnectionInterfaceRequestsAdaptor::EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties)
 {
     // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.EnsureChannel
+<<<<<<< HEAD
     //This method should return a Channel object path
     return static_cast<Connection *>(parent())->EnsureChannel(request, channel_object, channel_properties);
+=======
+    //return static_cast<YourObjectType *>(parent())->EnsureChannel(request, channel_object, channel_properties);
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 }
 
index 599856f..055e007 100644 (file)
@@ -43,7 +43,11 @@ class ConnectionManagerPrivate
 public:
     ConnectionManagerPrivate(ConnectionManager * parent) :
         adaptor(new ConnectionManagerAdaptor(parent)),
+<<<<<<< HEAD
         logUtility(new LogUtility(parent))
+=======
+        logUtility(new LogUtility("/var/log/vicar/vicar.log",parent))
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     {
         Q_ASSERT(0 != adaptor);
         activeConnection = 0;
@@ -73,6 +77,10 @@ ConnectionManager::GetParameters(const QString &proto)
     Q_ASSERT(!proto.isEmpty());    
     Q_UNUSED(proto);
     strMessage = "VICAR: ConnectionManager::GetParameters(const QString &prot)";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     org::freedesktop::Telepathy::ParameterDefinitionList result;
     org::freedesktop::Telepathy::ParameterDefinition param;
@@ -122,6 +130,10 @@ ConnectionManager::GetParameters(const QString &proto)
 QStringList ConnectionManager::ListProtocols()
 {
     QString strMessage = "VICaR ConnectionManager::ListProtocols()";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     return QStringList(protocol_name);
 }
@@ -131,6 +143,10 @@ QString ConnectionManager::RequestConnection(const QString & proto,
                                              QDBusObjectPath & object_path)
 {
     QString strMessage =  "VICaR CM: Connection Requested for protocol "+proto;
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
     QString connection_service;    
     //object_path = QDBusObjectPath();
@@ -142,6 +158,7 @@ QString ConnectionManager::RequestConnection(const QString & proto,
                        "VICaR - Unable to create Connection. Requested protocol is not implemented.");
         */
         strMessage =  "VICaR CM::RequestConnection: proto mismatch.";
+<<<<<<< HEAD
         d->logUtility->logMessage(strMessage);
         return connection_service;
     }
@@ -154,6 +171,22 @@ QString ConnectionManager::RequestConnection(const QString & proto,
         //emit NewConnection(connection_service, object_path, "tel"); //Just in case, emit the NewConnection again
         return connection_service;
     }
+=======
+        qDebug() << strMessage;
+        d->logUtility->logMessage(strMessage);
+        return connection_service;
+    }
+    if (d->activeConnection != 0){
+        strMessage =  "VICaR CM::RequestConnection: An active connection already exists at "+d->activeConnection->serviceName();
+        qDebug() << strMessage;
+        d->logUtility->logMessage(strMessage);
+
+        object_path = d->activeConnection->objectPath();
+        connection_service = d->activeConnection->serviceName();
+        //emit NewConnection(connection_service, object_path, "tel"); //Just in case, emit the NewConnection again
+        return connection_service;
+    }
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
     QString imsi;
     QString privacy;
@@ -185,29 +218,49 @@ QString ConnectionManager::RequestConnection(const QString & proto,
                            "VICaR - Unable to create Connection. Invalid parameters specified.");
             */
             strMessage =  "VICaR CM::RequestConnection: invalid parameter" + param + "found.";
+<<<<<<< HEAD
+=======
+            qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
             d->logUtility->logMessage(strMessage);
             return connection_service;
         }
     }
 
     strMessage =  "DEBUG CM: Trying to create new connection with account "+account;
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     Connection * new_connection = new Connection(account, this);
     Q_ASSERT(0 != new_connection);
 
     strMessage =  "DEBUG CM: Trying to register new connection";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     if (!new_connection->registerObject())
     {
         strMessage = "VICaR CM: Error while registering Connection object with DBus.";
+<<<<<<< HEAD
+=======
+        qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
         d->logUtility->logMessage(strMessage);
         new_connection->deleteLater();
         return QString();
     }
 
     strMessage =  "VICaR CM: New Connection Created. Status is " + QString(new_connection->GetStatus());
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
 
@@ -215,6 +268,10 @@ QString ConnectionManager::RequestConnection(const QString & proto,
     connection_service = new_connection->serviceName();
 
     strMessage =  "VICaR CM: Emitting New Connection Signal";
+<<<<<<< HEAD
+=======
+    qDebug() << strMessage;
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
     d->logUtility->logMessage(strMessage);
 
     emit NewConnection(connection_service, object_path, "tel");
index 87b28d1..aa4de48 100644 (file)
@@ -1,7 +1,11 @@
 #INCLUDEPATH += /usr/include/telepathy-1.0
 #LIBS += /usr/lib/libtelepathy-qt4.so
 
+<<<<<<< HEAD
 contains(MEEGO_EDITION,harmattan){
+=======
+exists($$QMAKE_INCDIR_QT"/../qmsystem2/qmkeys.h"){
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
    DEFINES += Q_WS_MAEMO_6
 }
 
index 545cb03..cd295ff 100755 (executable)
@@ -10,6 +10,7 @@
 #include "connectioninterfacerequeststypes.h"
 #include "harmattanaccountutility.h"
 #include <QDebug>
+<<<<<<< HEAD
 #include <QCoreApplication>
 #include "dbusutility.h"
 #include <QDBusMetaType>
 #define DBUS_SERVICE        "org.freedesktop.DBus.Properties"
 #define DBUS_OBJ_PATH       "/org/freedesktop/DBus/Properties"
 #define DBUS_PROPS_IFACE     "org.freedesktop.DBus.Properties"
+=======
+#include <QCoreApplication> //DEBUG - Delete this
+#include "dbusutility.h"
+#include <QDBusMetaType>
+#include <QDBusConnection>
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
 int main(int argc, char *argv[])
 {
@@ -107,6 +114,7 @@ int main(int argc, char *argv[])
             qDebug() << "Creating account";
             accountUtility->addAccount();
         }
+<<<<<<< HEAD
         else if (instruction == "--delete-account"){
             qDebug() << "Deleting account";
             accountUtility->removeAccount();
@@ -117,6 +125,66 @@ int main(int argc, char *argv[])
         }
     }
     else{                        
+=======
+        else if (instruction == "TPACCOUNTSTATUS"){
+            QString status = tpUtility->getAccountStatus();
+            qDebug() << "Account Status is "<< status;
+        }
+        else if (instruction == "--create-account"){
+#if defined(Q_WS_MAEMO_6)
+            qDebug() << "Creating account";
+            accountUtility->addAccount();
+#else
+            qDebug() << "This command is applicable only in harmattan";
+#endif
+        }
+        else if (instruction == "--delete-account"){
+#if defined(Q_WS_MAEMO_6)
+            qDebug() << "Deleting account";
+            accountUtility->removeAccount();
+#else
+            qDebug() << "This command is applicable only in harmattan";
+#endif
+        }
+        else if (instruction == "TESTING"){
+            tpUtility->callNumberWithRing(argv[2]);
+        }
+    }
+    else{                        
+
+        qDebug() << "Sending Introspect method call";
+
+        DbusUtility dbusUtility(&app);
+        QList<QVariant> argsToSend;
+
+
+        bool success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.Connection.ring.tel.ring",
+                                   "/org/freedesktop/Telepathy/Connection/ring/tel/ring",
+                                   "org.freedesktop.DBus.Introspectable",
+                                   "Introspect",argsToSend,false);
+
+        success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.ConnectionManager.ring",
+                                   "/org/freedesktop/Telepathy/ConnectionManager/ring",
+                                   "org.freedesktop.DBus.Introspectable",
+                                   "Introspect",argsToSend,false);
+
+        /*
+
+        bool success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.AccountManager",
+                                   "/org/freedesktop/Telepathy/Account/ring/tel/ring",
+                                   "org.freedesktop.Telepathy.Account",
+                                   "Reconnect",argsToSend,false);
+        */
+
+        if (!success){
+            qDebug() << dbusUtility.getErrorMessage();
+        }
+        else{
+            qDebug() << "Method call executed successfully";
+        }
+        app.exec();
+    }
+>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e
 
         qDebug() << QCryptographicHash::hash("VICaR",QCryptographicHash::Md5).toHex();
 
diff --git a/welcome b/welcome
deleted file mode 100755 (executable)
index e69de29..0000000