[Telepathy] [PATCH 3/3] add .(dot) at TP_QT_ACCOUNT_OBJECT_PATH_BASE end

Maksim Melnikau maxposedon at gmail.com
Sun Jan 6 11:12:12 PST 2013


this makes TP_QT_ACCOUNT_OBJECT_PATH_BASE to be like other defines
(TP_QT_CONNECTION_MANAGER_BUS_NAME_BASE,
TP_QT_CONNECTION_OBJECT_PATH_BASE, etc). E.g. if constant requires smth
to append - add separate to define, not at every usage.

Signed-off-by: Maksim Melnikau <maxposedon at gmail.com>
---
 TelepathyQt/account.cpp                  | 4 ++--
 TelepathyQt/constants.h                  | 2 +-
 examples/file-transfer/file-sender.cpp   | 2 +-
 examples/roster/roster-window.cpp        | 2 +-
 examples/stream-tubes/tube-initiator.cpp | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/TelepathyQt/account.cpp b/TelepathyQt/account.cpp
index c35759a..23ceab2 100644
--- a/TelepathyQt/account.cpp
+++ b/TelepathyQt/account.cpp
@@ -665,7 +665,7 @@ Account::Private::Private(Account *parent, const ConnectionFactoryConstPtr &conn
     // FIXME: QRegExp probably isn't the most efficient possible way to parse
     //        this :-)
     QRegExp rx(QLatin1String("^") + TP_QT_ACCOUNT_OBJECT_PATH_BASE +
-                QLatin1String("/([_A-Za-z][_A-Za-z0-9]*)"  // cap(1) is the CM
+                QLatin1String("([_A-Za-z][_A-Za-z0-9]*)"  // cap(1) is the CM
                 "/([_A-Za-z][_A-Za-z0-9]*)"  // cap(2) is the protocol
                 "/([_A-Za-z][_A-Za-z0-9]*)"  // account-specific part
                 ));
@@ -678,7 +678,7 @@ Account::Private::Private(Account *parent, const ConnectionFactoryConstPtr &conn
             "trying again with a different account-specific part check";
 
         rx = QRegExp(QLatin1String("^") + TP_QT_ACCOUNT_OBJECT_PATH_BASE +
-                    QLatin1String("/([_A-Za-z][_A-Za-z0-9]*)"  // cap(1) is the CM
+                    QLatin1String("([_A-Za-z][_A-Za-z0-9]*)"  // cap(1) is the CM
                     "/([_A-Za-z][_A-Za-z0-9]*)"  // cap(2) is the protocol
                     "/([_A-Za-z0-9]*)"  // account-specific part
                     ));
diff --git a/TelepathyQt/constants.h b/TelepathyQt/constants.h
index 2059b9b..62b0981 100644
--- a/TelepathyQt/constants.h
+++ b/TelepathyQt/constants.h
@@ -104,7 +104,7 @@
  * \see Tp::Account
  */
 #define TP_QT_ACCOUNT_OBJECT_PATH_BASE \
-    (QLatin1String("/org/freedesktop/Telepathy/Account"))
+    (QLatin1String("/org/freedesktop/Telepathy/Account/"))
 
 /**
  * The object path of the Debug object of various services.
diff --git a/examples/file-transfer/file-sender.cpp b/examples/file-transfer/file-sender.cpp
index a747af1..10ee754 100644
--- a/examples/file-transfer/file-sender.cpp
+++ b/examples/file-transfer/file-sender.cpp
@@ -94,7 +94,7 @@ void FileSender::onAMReady(PendingOperation *op)
     qDebug() << "AccountManager ready";
 
     mAccount = mAM->accountForObjectPath(
-            TP_QT_ACCOUNT_OBJECT_PATH_BASE + QLatin1Char('/') + mAccountName);
+            TP_QT_ACCOUNT_OBJECT_PATH_BASE + mAccountName);
     if (!mAccount) {
         qWarning() << "The account given does not exist";
         QCoreApplication::exit(1);
diff --git a/examples/roster/roster-window.cpp b/examples/roster/roster-window.cpp
index db42a9e..eeb9ce1 100644
--- a/examples/roster/roster-window.cpp
+++ b/examples/roster/roster-window.cpp
@@ -52,7 +52,7 @@ RosterWindow::RosterWindow(const QString &accountName, QWidget *parent)
             Contact::FeatureAlias | Contact::FeatureSimplePresence);
 
     mAccount = Account::create(TP_QT_ACCOUNT_MANAGER_BUS_NAME,
-            TP_QT_ACCOUNT_OBJECT_PATH_BASE + QLatin1Char('/') + accountName,
+            TP_QT_ACCOUNT_OBJECT_PATH_BASE + accountName,
             connectionFactory, channelFactory, contactFactory);
     connect(mAccount->becomeReady(Account::FeatureCore),
             SIGNAL(finished(Tp::PendingOperation *)),
diff --git a/examples/stream-tubes/tube-initiator.cpp b/examples/stream-tubes/tube-initiator.cpp
index b645466..3e5351f 100644
--- a/examples/stream-tubes/tube-initiator.cpp
+++ b/examples/stream-tubes/tube-initiator.cpp
@@ -82,7 +82,7 @@ TubeInitiator::TubeInitiator(const QString &accountName, const QString &receiver
 
     connect(accountFactory->proxy(
                 TP_QT_ACCOUNT_MANAGER_BUS_NAME,
-                TP_QT_ACCOUNT_OBJECT_PATH_BASE + QLatin1Char('/') + accountName,
+                TP_QT_ACCOUNT_OBJECT_PATH_BASE + accountName,
                 connectionFactory,
                 mTubeServer->registrar()->channelFactory(),
                 mTubeServer->registrar()->contactFactory()),
-- 
1.8.1



More information about the telepathy mailing list