[Telepathy-commits] [telepathy-qt4/master] Moved cmName and protocolName from ProtocolInfo private class.

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


Moved cmName and protocolName from ProtocolInfo private class and made the
getters methods inline.
---
 TelepathyQt4/cli-connection-manager.cpp |   25 ++++---------------------
 TelepathyQt4/cli-connection-manager.h   |    8 +++++---
 2 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/TelepathyQt4/cli-connection-manager.cpp b/TelepathyQt4/cli-connection-manager.cpp
index d6f45b8..4870635 100644
--- a/TelepathyQt4/cli-connection-manager.cpp
+++ b/TelepathyQt4/cli-connection-manager.cpp
@@ -87,19 +87,14 @@ bool ProtocolParameter::operator==(const QString &name) const
 
 struct ProtocolInfo::Private
 {
-    QString cmName;
-    QString protocolName;
     ProtocolParameterList params;
-
-    Private(const QString& cmName, const QString& protocolName)
-        : cmName(cmName), protocolName(protocolName)
-    {
-    }
 };
 
 
-ProtocolInfo::ProtocolInfo(const QString& cmName, const QString& protocol)
-    : mPriv(new Private(cmName, protocol))
+ProtocolInfo::ProtocolInfo(const QString &cmName, const QString &protocolName)
+    : mPriv(new Private()),
+      mCmName(cmName),
+      mProtocolName(protocolName)
 {
 }
 
@@ -112,18 +107,6 @@ ProtocolInfo::~ProtocolInfo()
 }
 
 
-QString ProtocolInfo::cmName() const
-{
-    return mPriv->cmName;
-}
-
-
-QString ProtocolInfo::protocolName() const
-{
-    return mPriv->protocolName;
-}
-
-
 const ProtocolParameterList &ProtocolInfo::parameters() const
 {
     return mPriv->params;
diff --git a/TelepathyQt4/cli-connection-manager.h b/TelepathyQt4/cli-connection-manager.h
index 48e9d22..7cbb8b1 100644
--- a/TelepathyQt4/cli-connection-manager.h
+++ b/TelepathyQt4/cli-connection-manager.h
@@ -98,13 +98,13 @@ public:
      *
      * \return The name of the connection manager
      */
-    QString cmName() const;
+    QString cmName() const { return mCmName; }
 
     /**
      * Get the untranslated name of the protocol as described in the Telepathy
      * D-Bus API Specification (e.g. "jabber").
      */
-    QString protocolName() const;
+    QString protocolName() const { return mProtocolName; }
 
     /**
      * Return all supported parameters. The parameters' names
@@ -135,7 +135,7 @@ public:
     bool canRegister() const;
 
 private:
-    ProtocolInfo(const QString& cmName, const QString& protocol);
+    ProtocolInfo(const QString &cmName, const QString &protocolName);
 
     void addParameter(const ParamSpec &spec);
 
@@ -143,6 +143,8 @@ private:
     friend struct Private;
     friend class ConnectionManager;
     Private *mPriv;
+    QString mCmName;
+    QString mProtocolName;
 };
 
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list