summaryrefslogtreecommitdiff
path: root/saltoqd/cardmanageradaptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'saltoqd/cardmanageradaptor.cpp')
-rw-r--r--saltoqd/cardmanageradaptor.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/saltoqd/cardmanageradaptor.cpp b/saltoqd/cardmanageradaptor.cpp
new file mode 100644
index 0000000..02ab4a8
--- /dev/null
+++ b/saltoqd/cardmanageradaptor.cpp
@@ -0,0 +1,20 @@
+#include "cardmanageradaptor.h"
+
+CardManagerAdaptor::CardManagerAdaptor(CardManager *parent)
+ : QDBusAbstractAdaptor(parent),
+ _conn(QDBusConnection::sessionBus()),
+ _mgr(parent)
+{
+ setAutoRelaySignals(true);
+}
+
+QDBusObjectPath CardManagerAdaptor::CreateDeck(const QString &application, const QDBusMessage &msg)
+{
+ QString sender = msg.service();
+ CardDeck *deck = new CardDeck(sender, application, _mgr);
+ QDBusObjectPath path("/com/javispedro/saltoq/CardManager/" + application);
+ deck->setObjectName(application);
+ _mgr->installDeck(deck);
+ _decks.insert(path, deck);
+ return path;
+}