[Telepathy-commits] [telepathy-qt4/master] Moved ConnectionManager::mName to ConnectionManager::Private::name.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Jan 6 11:58:40 PST 2009


---
 TelepathyQt4/Client/connection-manager-internal.h |    3 ++-
 TelepathyQt4/Client/connection-manager.cpp        |   21 +++++++++++++--------
 TelepathyQt4/Client/connection-manager.h          |    3 +--
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/TelepathyQt4/Client/connection-manager-internal.h b/TelepathyQt4/Client/connection-manager-internal.h
index b6d706b..274025f 100644
--- a/TelepathyQt4/Client/connection-manager-internal.h
+++ b/TelepathyQt4/Client/connection-manager-internal.h
@@ -42,7 +42,7 @@ class ConnectionManager::Private : public QObject
     Q_OBJECT
 
 public:
-    Private(ConnectionManager *parent);
+    Private(const QString &name, ConnectionManager *parent);
     ~Private();
 
     static QString makeBusName(const QString& name);
@@ -61,6 +61,7 @@ public:
 
     ConnectionManager *parent;
     ConnectionManagerInterface* baseInterface;
+    QString name;
     bool ready;
     QQueue<void (Private::*)()> introspectQueue;
     QQueue<QString> getParametersQueue;
diff --git a/TelepathyQt4/Client/connection-manager.cpp b/TelepathyQt4/Client/connection-manager.cpp
index ddd0015..cb22fc4 100644
--- a/TelepathyQt4/Client/connection-manager.cpp
+++ b/TelepathyQt4/Client/connection-manager.cpp
@@ -225,11 +225,12 @@ void ConnectionManager::Private::PendingNames::parseResult(const QStringList &na
 }
 
 
-ConnectionManager::Private::Private(ConnectionManager *parent)
+ConnectionManager::Private::Private(const QString &name, ConnectionManager *parent)
     : QObject(parent),
       parent(parent),
       baseInterface(new ConnectionManagerInterface(parent->dbusConnection(),
                     parent->busName(), parent->objectPath(), parent)),
+      name(name),
       ready(false),
       pendingReady(0)
 {
@@ -275,13 +276,13 @@ ProtocolInfo *ConnectionManager::Private::protocol(const QString &protocolName)
 
 bool ConnectionManager::Private::checkConfigFile()
 {
-    ManagerFile f(parent->name());
+    ManagerFile f(name);
     if (!f.isValid()) {
         return false;
     }
 
     Q_FOREACH (QString protocol, f.protocols()) {
-        ProtocolInfo *info = new ProtocolInfo(parent->name(),
+        ProtocolInfo *info = new ProtocolInfo(name,
                                               protocol);
         protocols.append(info);
 
@@ -394,7 +395,7 @@ void ConnectionManager::Private::onListProtocolsReturn(
     }
 
     Q_FOREACH (const QString &protocolName, protocolsNames) {
-        protocols.append(new ProtocolInfo(parent->name(),
+        protocols.append(new ProtocolInfo(name,
                                           protocolName));
 
         getParametersQueue.enqueue(protocolName);
@@ -454,8 +455,7 @@ ConnectionManager::ConnectionManager(const QString& name, QObject* parent)
     : StatelessDBusProxy(QDBusConnection::sessionBus(),
             Private::makeBusName(name), Private::makeObjectPath(name),
             parent),
-      mPriv(new Private(this)),
-      mName(name)
+      mPriv(new Private(name, this))
 {
 }
 
@@ -464,8 +464,7 @@ ConnectionManager::ConnectionManager(const QDBusConnection& bus,
         const QString& name, QObject* parent)
     : StatelessDBusProxy(bus, Private::makeBusName(name),
             Private::makeObjectPath(name), parent),
-      mPriv(new Private(this)),
-      mName(name)
+      mPriv(new Private(name, this))
 {
 }
 
@@ -476,6 +475,12 @@ ConnectionManager::~ConnectionManager()
 }
 
 
+QString ConnectionManager::name() const
+{
+    return mPriv->name;
+}
+
+
 QStringList ConnectionManager::interfaces() const
 {
     return mPriv->interfaces;
diff --git a/TelepathyQt4/Client/connection-manager.h b/TelepathyQt4/Client/connection-manager.h
index ca310b5..c93c30e 100644
--- a/TelepathyQt4/Client/connection-manager.h
+++ b/TelepathyQt4/Client/connection-manager.h
@@ -185,7 +185,7 @@ public:
 
     virtual ~ConnectionManager();
 
-    QString name() const { return mName; }
+    QString name() const;
 
     QStringList interfaces() const;
 
@@ -247,7 +247,6 @@ private:
     class Private;
     friend class Private;
     Private *mPriv;
-    QString mName;
 };
 
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list