[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/dataengines/presence
From:       Dariusz Mikulski <dariusz.mikulski () gmail ! com>
Date:       2009-01-13 21:56:58
Message-ID: 1231883818.031312.26713.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 910659 by mikulski:

update to new TelepathyQt4 API

 M  +12 -16    presence.cpp  
 M  +3 -3      presence.h  


--- trunk/playground/base/plasma/dataengines/presence/presence.cpp #910658:910659
@@ -36,17 +36,17 @@
 	
 	Telepathy::Client::AccountManager * m_accountManager;
 	
-	void createAccountDataSource(const QDBusObjectPath &path)
+	void createAccountDataSource(const QString &path)
 	{
 		// \todo: FIXME
 		kDebug() << "createAccountDataSource called";
-		kDebug() << path.path();
+		kDebug() << path;
 	    Telepathy::Client::Account *account = accountFromObjectPath(path);
 
 	    QString source;
 	    // \todo: FIXME
 	    // source = account.uniqueIdentifier();
-	    source = path.path();
+	    source = path;
 	    
 	    Telepathy::SimplePresence sp = account->currentPresence();
 	    QVariant vsp;
@@ -77,24 +77,22 @@
 */
 	}
 	
-	void removeAccountDataSource(const QDBusObjectPath &path)
+	void removeAccountDataSource(const QString &path)
 	{
 		kDebug() << "removeAccountDataSource called";
-		kDebug() << path.path();
+		kDebug() << path;
 		
-		Telepathy::Client::Account *account = accountFromObjectPath(path);
-		
 		// \todo: FIXME
 /*
 		QString identifier = account->uniqueIdentifier();
 		parent->removeSource(identifier);
 		emit parent->sourceRemoved(identifier);
 */
-		QString identifier = path.path();
+		QString identifier = path;
 		parent->removeSource(identifier);
 	}
 	
-	Telepathy::Client::Account *accountFromObjectPath(const QDBusObjectPath &path)
+	Telepathy::Client::Account *accountFromObjectPath(const QString &path)
 	{
 		return m_accountManager->accountForPath(path);
 	}
@@ -210,7 +208,7 @@
 		return;
 	}
 	
-    Telepathy::ObjectPathList pathList = d->m_accountManager->allAccountPaths();
+    QStringList pathList = d->m_accountManager->allAccountPaths();
     kDebug() << "All Account Paths: " << pathList.size();
     
     /*
@@ -220,13 +218,11 @@
     QList<Telepathy::Client::Account *> accounts = d->m_accountManager->allAccounts();
     kDebug() << "accounts: " << accounts.size();
     
-    Telepathy::ObjectPathList objectPathList = d->m_accountManager->allAccountPaths();
-    
     /*
      * create a datasource for each
      * of the accounts we got in the list.
      */
-    foreach(const QDBusObjectPath &path, objectPathList)
+    foreach(const QString &path, pathList)
     {
         d->createAccountDataSource(path);
     }
@@ -237,7 +233,7 @@
  * 
  * \param path QDBusObjectPath to created account.
  */
-void PresenceEngine::accountCreated(const QDBusObjectPath &path)
+void PresenceEngine::accountCreated(const QString &path)
 {
     kDebug() << "accountCreated() called";
     // Load the data for the new account. To avoid duplicating code, we treat
@@ -252,7 +248,7 @@
  * \param QDBusObjectPath Name of the account path.
  * \param valid true if the account is valid.
  */
-void PresenceEngine::accountValidityChanged(const QDBusObjectPath &path, bool valid)
+void PresenceEngine::accountValidityChanged(const QString &path, bool valid)
 {
 	Q_UNUSED(valid);
     kDebug() << "accountValidityChanged() called";
@@ -268,7 +264,7 @@
  * 
  * \param QDBusObjectPath Name of the account path.
  */
-void PresenceEngine::accountRemoved(const QDBusObjectPath &path)
+void PresenceEngine::accountRemoved(const QString &path)
 {
     kDebug() << "accountRemoved() called";
     /*
--- trunk/playground/base/plasma/dataengines/presence/presence.h #910658:910659
@@ -38,9 +38,9 @@
 
 private Q_SLOTS:
 	void onAccountReady(Telepathy::Client::PendingOperation *operation);
-    void accountCreated(const QDBusObjectPath &path);
-    void accountRemoved(const QDBusObjectPath &path);
-    void accountValidityChanged(const QDBusObjectPath &path, bool valid);
+    void accountCreated(const QString &path);
+    void accountRemoved(const QString &path);
+    void accountValidityChanged(const QString &path, bool valid);
 
 private:
 	class PresenceEnginePrivate;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic