telepathy-qt: Refactor: objectPath member moved from DBusService to DBusObject.
David Edmundson
davidedmundson at kemper.freedesktop.org
Thu Feb 12 05:48:03 PST 2015
Module: telepathy-qt
Branch: master
Commit: b735cc11f56cd99c7bf2175f89ee7c77ee4509db
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=b735cc11f56cd99c7bf2175f89ee7c77ee4509db
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Tue Feb 10 18:45:01 2015 +0500
Refactor: objectPath member moved from DBusService to DBusObject.
---
TelepathyQt/dbus-object.cpp | 11 +++++++++++
TelepathyQt/dbus-object.h | 6 ++++++
TelepathyQt/dbus-service.cpp | 5 ++---
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/TelepathyQt/dbus-object.cpp b/TelepathyQt/dbus-object.cpp
index cab20a0..9e3bdfe 100644
--- a/TelepathyQt/dbus-object.cpp
+++ b/TelepathyQt/dbus-object.cpp
@@ -37,6 +37,7 @@ struct TP_QT_NO_EXPORT DBusObject::Private
}
QDBusConnection dbusConnection;
+ QString objectPath;
};
/**
@@ -68,6 +69,16 @@ DBusObject::~DBusObject()
delete mPriv;
}
+void DBusObject::setObjectPath(const QString &path)
+{
+ mPriv->objectPath = path;
+}
+
+QString DBusObject::objectPath() const
+{
+ return mPriv->objectPath;
+}
+
/**
* Return the D-Bus connection associated with this object.
*
diff --git a/TelepathyQt/dbus-object.h b/TelepathyQt/dbus-object.h
index 1784fe0..0ed19af 100644
--- a/TelepathyQt/dbus-object.h
+++ b/TelepathyQt/dbus-object.h
@@ -45,12 +45,18 @@ public:
DBusObject(const QDBusConnection &dbusConnection, QObject *parent = 0);
virtual ~DBusObject();
+ QString objectPath() const;
QDBusConnection dbusConnection() const;
+protected:
+ void setObjectPath(const QString &path);
+
private:
class Private;
friend class Private;
Private *mPriv;
+
+ friend class DBusService;
};
}
diff --git a/TelepathyQt/dbus-service.cpp b/TelepathyQt/dbus-service.cpp
index 6a8f978..607003e 100644
--- a/TelepathyQt/dbus-service.cpp
+++ b/TelepathyQt/dbus-service.cpp
@@ -46,7 +46,6 @@ struct TP_QT_NO_EXPORT DBusService::Private
DBusService *parent;
QString busName;
- QString objectPath;
DBusObject *dbusObject;
bool registered;
};
@@ -113,7 +112,7 @@ QString DBusService::busName() const
*/
QString DBusService::objectPath() const
{
- return mPriv->objectPath;
+ return mPriv->dbusObject->objectPath();
}
/**
@@ -186,7 +185,7 @@ bool DBusService::registerObject(const QString &busName, const QString &objectPa
debug() << "Registered object" << objectPath << "at bus name" << busName;
mPriv->busName = busName;
- mPriv->objectPath = objectPath;
+ mPriv->dbusObject->setObjectPath(objectPath);
mPriv->registered = true;
return true;
}
More information about the telepathy-commits
mailing list