#include #include #include #include "fakepropertyadaptor.h" FakePropertyAdaptor::FakePropertyAdaptor(FakeProperty* property) : QDBusAbstractAdaptor(property), _property(property) { } QString FakePropertyAdaptor::objectPath() const { if (_property->key().startsWith("/")) return QString(_property->key()); return QString("/org/maemo/contextkit/") + QString(_property->key()).replace(".", "/").replace(QRegExp("[^A-Za-z0-9_/]"), "_"); } void FakePropertyAdaptor::Subscribe(const QDBusMessage& msg, QVariantList& values, quint64& timestamp) { qDebug() << "subscribe from " << msg.service(); Get(values, timestamp); } void FakePropertyAdaptor::Unsubscribe(const QDBusMessage& msg) { qDebug() << "unsubscribe from " << msg.service(); } void FakePropertyAdaptor::Get(QVariantList& values, quint64& timestamp) { values << _property->value(); timestamp = -1LL; }