summaryrefslogtreecommitdiff
path: root/faker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'faker.cpp')
-rw-r--r--faker.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/faker.cpp b/faker.cpp
new file mode 100644
index 0000000..b512439
--- /dev/null
+++ b/faker.cpp
@@ -0,0 +1,25 @@
+#include "faker.h"
+
+#define SERVICE_NAME "com.javispedro.glol"
+
+Faker::Faker(const QString& val, QObject *parent) :
+ QObject(parent), _bus(QDBusConnection::sessionBus()),
+ _property(new FakeProperty("Screen.TopEdge")),
+ _adaptor(new FakePropertyAdaptor(_property))
+{
+ _property->setValue(val);
+}
+
+void Faker::start()
+{
+ _bus.registerObject(_adaptor->objectPath(), _property);
+ _bus.registerService(SERVICE_NAME);
+ _property->startFaking();
+}
+
+void Faker::stop()
+{
+ _property->stopFaking();
+ _bus.unregisterService(SERVICE_NAME);
+ _bus.unregisterObject(_adaptor->objectPath());
+}