X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fvicar-telepathy%2Fcpp%2Fconnectionmanager.cpp;h=055e0078f202d1731e52d361e4fa8b5f4d9a42e3;hb=2beca638f4ba146e25320c9c07cc1f29d0b2bba2;hp=b4495f0f0e3042cb2815c7e7eadb96839f483239;hpb=74800375ecf7f41e290cf7cc7fa9ee8b230be68e;p=vicar diff --git a/src/vicar-telepathy/cpp/connectionmanager.cpp b/src/vicar-telepathy/cpp/connectionmanager.cpp index b4495f0..055e007 100644 --- a/src/vicar-telepathy/cpp/connectionmanager.cpp +++ b/src/vicar-telepathy/cpp/connectionmanager.cpp @@ -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,7 +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; @@ -123,7 +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); } @@ -133,7 +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(); @@ -145,6 +158,20 @@ 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; + } + if (d->activeConnection != 0){ + strMessage = "VICaR CM::RequestConnection: An active connection already exists at "+d->activeConnection->serviceName(); + 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; + } +======= qDebug() << strMessage; d->logUtility->logMessage(strMessage); return connection_service; @@ -159,6 +186,7 @@ QString ConnectionManager::RequestConnection(const QString & proto, //emit NewConnection(connection_service, object_path, "tel"); //Just in case, emit the NewConnection again return connection_service; } +>>>>>>> 74800375ecf7f41e290cf7cc7fa9ee8b230be68e QString imsi; QString privacy; @@ -190,34 +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); @@ -225,7 +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");