[Telepathy-commits] [telepathy-qt4/master] Moved cmName from private class on ConnectionManager.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Mon Jan 5 08:56:30 PST 2009


Moved cmName from private class on ConnectionManager and made the getter
method inline.
---
 TelepathyQt4/cli-connection-manager.cpp |   16 +++++-----------
 TelepathyQt4/cli-connection-manager.h   |    4 ++--
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/TelepathyQt4/cli-connection-manager.cpp b/TelepathyQt4/cli-connection-manager.cpp
index 9208bd9..beb01eb 100644
--- a/TelepathyQt4/cli-connection-manager.cpp
+++ b/TelepathyQt4/cli-connection-manager.cpp
@@ -151,7 +151,6 @@ void ProtocolInfo::addParameter(const ParamSpec &spec)
 struct ConnectionManager::Private
 {
     ConnectionManager& parent;
-    QString cmName;
     ConnectionManagerInterface* baseInterface;
     bool ready;
     QQueue<void (Private::*)()> introspectQueue;
@@ -226,7 +225,6 @@ struct ConnectionManager::Private
 
     Private(ConnectionManager& parent, QString name)
         : parent(parent),
-          cmName(name),
           baseInterface(new ConnectionManagerInterface(parent.dbusConnection(),
                       parent.busName(), parent.objectPath(), &parent)),
           ready(false)
@@ -244,7 +242,8 @@ ConnectionManager::ConnectionManager(const QString& name, QObject* parent)
     : StatelessDBusProxy(QDBusConnection::sessionBus(),
             Private::makeBusName(name), Private::makeObjectPath(name),
             parent),
-      mPriv(new Private(*this, name))
+      mPriv(new Private(*this, name)),
+      mCmName(name)
 {
 }
 
@@ -253,7 +252,8 @@ ConnectionManager::ConnectionManager(const QDBusConnection& bus,
         const QString& name, QObject* parent)
     : StatelessDBusProxy(bus, Private::makeBusName(name),
             Private::makeObjectPath(name), parent),
-      mPriv(new Private(*this, name))
+      mPriv(new Private(*this, name)),
+      mCmName(name)
 {
 }
 
@@ -264,12 +264,6 @@ ConnectionManager::~ConnectionManager()
 }
 
 
-QString ConnectionManager::cmName() const
-{
-    return mPriv->cmName;
-}
-
-
 QStringList ConnectionManager::interfaces() const
 {
     return mPriv->interfaces;
@@ -344,7 +338,7 @@ void ConnectionManager::onListProtocolsReturn(
     }
 
     Q_FOREACH (const QString &protocolName, protocols) {
-        mPriv->protocols.append(new ProtocolInfo(mPriv->cmName,
+        mPriv->protocols.append(new ProtocolInfo(mCmName,
                                                  protocolName));
 
         mPriv->getParametersQueue.enqueue(protocolName);
diff --git a/TelepathyQt4/cli-connection-manager.h b/TelepathyQt4/cli-connection-manager.h
index d77f198..3b3142a 100644
--- a/TelepathyQt4/cli-connection-manager.h
+++ b/TelepathyQt4/cli-connection-manager.h
@@ -174,7 +174,7 @@ public:
 
     virtual ~ConnectionManager();
 
-    QString cmName() const;
+    QString cmName() const { return mCmName; }
 
     QStringList interfaces() const;
 
@@ -221,9 +221,9 @@ private:
     struct Private;
     friend struct Private;
     Private *mPriv;
+    QString mCmName;
 };
 
-
 }
 }
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list