summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2011-04-05 23:55:31 (GMT)
committerMateu Batle <mateu.batle@collabora.co.uk>2011-04-05 23:55:31 (GMT)
commit56056922378a01029a65a7533f740bb67f017050 (patch)
treec9d8cf62972ccd3ecfa85b46af708e31aee99103
parent1ef6af0ae99c4c7ea25b432e1d9e622a97478bd6 (diff)
downloadtelepathy-qt4-logger-master.tar.gz
telepathy-qt4-logger-master.tar.xz
Moved member variables to private structHEADmaster
-rw-r--r--TelepathyQt4Logger/logger.cpp30
-rw-r--r--TelepathyQt4Logger/logger.h7
2 files changed, 25 insertions, 12 deletions
diff --git a/TelepathyQt4Logger/logger.cpp b/TelepathyQt4Logger/logger.cpp
index 86f0f5d..dd8eca3 100644
--- a/TelepathyQt4Logger/logger.cpp
+++ b/TelepathyQt4Logger/logger.cpp
@@ -30,46 +30,60 @@ namespace Tpl {
typedef Tp::SharedPtr<Logger> LoggerPtr;
+struct TELEPATHY_QT4_LOGGER_NO_EXPORT Logger::Private
+{
+ Private(Logger *self);
+
+ Tpl::LoggerInterface *mInterface;
+ LoggerPtr mPtr;
+};
+
+Logger::Private::Private(Logger *self)
+{
+ mInterface = new Tpl::LoggerInterface(QDBusConnection::sessionBus(),
+ TPL_DBUS_SRV_WELL_KNOWN_BUS_NAME,
+ TPL_DBUS_SRV_OBJECT_PATH);
+ mPtr = LoggerPtr(self);
+}
+
Logger::Logger() :
Tp::StatelessDBusProxy(QDBusConnection::sessionBus(),
QLatin1String(TPL_DBUS_SRV_WELL_KNOWN_BUS_NAME),
QLatin1String(TPL_DBUS_SRV_OBJECT_PATH),
Tp::Feature()),
- mInterface(0)
+ mPriv(new Private(this))
{
- mInterface = new Tpl::LoggerInterface(QDBusConnection::sessionBus(),
- TPL_DBUS_SRV_WELL_KNOWN_BUS_NAME, TPL_DBUS_SRV_OBJECT_PATH);
- mPtr = LoggerPtr(this);
}
Logger::~Logger()
{
+ delete mPriv;
}
Tp::PendingOperation *Logger::clearLog() const
{
- PendingLogger *operation = new PendingLogger(mPtr, mInterface);
+ PendingLogger *operation = new PendingLogger(mPriv->mPtr, mPriv->mInterface);
operation->clearLog();
return operation;
}
Tp::PendingOperation *Logger::clearAccount(const Tp::AccountPtr &account) const
{
- PendingLogger *operation = new PendingLogger(mPtr, mInterface);
+ PendingLogger *operation = new PendingLogger(mPriv->mPtr, mPriv->mInterface);
operation->clearAccount(account);
return operation;
}
Tp::PendingOperation *Logger::clearContact(const Tp::AccountPtr &account, const QString &objectId) const
{
- PendingLogger *operation = new PendingLogger(mPtr, mInterface);
+ PendingLogger *operation = new PendingLogger(mPriv->mPtr, mPriv->mInterface);
operation->clearContact(account, objectId);
return operation;
}
Tp::PendingOperation *Logger::clearRoom(const Tp::AccountPtr &account, const QString &objectId) const
{
- PendingLogger *operation = new PendingLogger(mPtr, mInterface);
+ PendingLogger *operation = new PendingLogger(mPriv->mPtr, mPriv->mInterface);
operation->clearRoom(account, objectId);
return operation;
}
diff --git a/TelepathyQt4Logger/logger.h b/TelepathyQt4Logger/logger.h
index 8175858..cd8f593 100644
--- a/TelepathyQt4Logger/logger.h
+++ b/TelepathyQt4Logger/logger.h
@@ -40,8 +40,6 @@ namespace Tpl
class Logger;
-typedef Tp::SharedPtr<Logger> LoggerPtr;
-
class TELEPATHY_QT4_LOGGER_EXPORT Logger : public Tp::StatelessDBusProxy
{
Q_OBJECT
@@ -56,8 +54,9 @@ public:
Tp::PendingOperation *clearRoom(const Tp::AccountPtr &account, const QString &objectId) const;
private:
- Tpl::LoggerInterface *mInterface;
- LoggerPtr mPtr;
+ struct Private;
+ friend struct Private;
+ Private *mPriv;
};
}