telepathy-qt: account: Change QMap to QHash where possible

Dario Freddi drf at kemper.freedesktop.org
Mon Jul 2 06:56:23 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 476c59236fd579a89596b0528b182efd8b37b70c
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=476c59236fd579a89596b0528b182efd8b37b70c

Author: Dario Freddi <dario.freddi at collabora.com>
Date:   Sun Apr 29 16:04:18 2012 +0200

account: Change QMap to QHash where possible

---

 TelepathyQt/account.cpp |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/TelepathyQt/account.cpp b/TelepathyQt/account.cpp
index d86c43f..1bcd40a 100644
--- a/TelepathyQt/account.cpp
+++ b/TelepathyQt/account.cpp
@@ -586,7 +586,7 @@ struct TP_QT_NO_EXPORT Account::Private
 
     // The contexts should never be removed from the map, to guarantee O(1) CD introspections per bus
     struct DispatcherContext;
-    static QMap<QString, QSharedPointer<DispatcherContext> > dispatcherContexts;
+    static QHash<QString, QSharedPointer<DispatcherContext> > dispatcherContexts;
     QSharedPointer<DispatcherContext> dispatcherContext;
 };
 
@@ -759,7 +759,7 @@ QString Account::Private::connectionObjectPath() const
     return !connection.isNull() ? connection->objectPath() : QString();
 }
 
-QMap<QString, QSharedPointer<Account::Private::DispatcherContext> > Account::Private::dispatcherContexts;
+QHash<QString, QSharedPointer<Account::Private::DispatcherContext> > Account::Private::dispatcherContexts;
 
 /**
  * \class Account
@@ -1801,7 +1801,7 @@ bool Account::isChangingPresence() const
  */
 PresenceSpecList Account::allowedPresenceStatuses(bool includeAllStatuses) const
 {
-    QMap<QString, PresenceSpec> specMap;
+    QHash<QString, PresenceSpec> specMap;
 
     // if the connection is online and ready use it
     if (mPriv->connection &&
@@ -1853,8 +1853,8 @@ PresenceSpecList Account::allowedPresenceStatuses(bool includeAllStatuses) const
 
             // now remove all presences that are not in the Profile, if it does
             // not allow other presences, and the ones that are disabled
-            QMap<QString, PresenceSpec>::iterator i = specMap.begin();
-            QMap<QString, PresenceSpec>::iterator end = specMap.end();
+            QHash<QString, PresenceSpec>::iterator i = specMap.begin();
+            QHash<QString, PresenceSpec>::iterator end = specMap.end();
             while (i != end) {
                 PresenceSpec presence = i.value();
                 QString status = presence.presence().status();
@@ -1871,8 +1871,8 @@ PresenceSpecList Account::allowedPresenceStatuses(bool includeAllStatuses) const
 
     // filter out presences that may not be set on self if includeAllStatuses is false
     if (!includeAllStatuses) {
-        QMap<QString, PresenceSpec>::iterator i = specMap.begin();
-        QMap<QString, PresenceSpec>::iterator end = specMap.end();
+        QHash<QString, PresenceSpec>::iterator i = specMap.begin();
+        QHash<QString, PresenceSpec>::iterator end = specMap.end();
         while (i != end) {
             PresenceSpec presence = i.value();
             if (!presence.maySetOnSelf()) {



More information about the telepathy-commits mailing list