diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-06 17:22:25 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-09 01:57:32 +0200 |
| commit | 7283842cbed6a378d430552d327eab4a27775538 (patch) | |
| tree | 708f4a2b4e702ddcc07bef8e6fdcd8f8a32a23ef /app | |
| parent | d3d54722d8532bd649db6792126c0a990712e26c (diff) | |
Moved watchConnector to daemon and implemented daemon interface for QML
Diffstat (limited to 'app')
| -rw-r--r-- | app/app.pro | 9 | ||||
| -rw-r--r-- | app/daemonproxy.cpp | 26 | ||||
| -rw-r--r-- | app/daemonproxy.h | 66 | ||||
| -rw-r--r-- | app/pebble.cpp | 8 |
4 files changed, 100 insertions, 9 deletions
diff --git a/app/app.pro b/app/app.pro index c9156f0..5d587cd 100644 --- a/app/app.pro +++ b/app/app.pro @@ -3,12 +3,13 @@ TARGET = pebble CONFIG += sailfishapp SOURCES += \ - pebble.cpp + pebble.cpp \ + daemonproxy.cpp -INCLUDEPATH += ../lib -LIBS += -L$$OUT_PWD/../lib -lpebble +HEADERS += \ + daemonproxy.h -QT += bluetooth +QT += dbus QMAKE_CXXFLAGS += -std=c++0x OTHER_FILES += \ diff --git a/app/daemonproxy.cpp b/app/daemonproxy.cpp new file mode 100644 index 0000000..24eedb5 --- /dev/null +++ b/app/daemonproxy.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -a daemon/dbusadaptor -p app/daemonproxy daemon/org.pebbled.xml + * + * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "daemonproxy.h" + +/* + * Implementation of interface class OrgPebbledInterface + */ + +OrgPebbledInterface::OrgPebbledInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +OrgPebbledInterface::~OrgPebbledInterface() +{ +} + diff --git a/app/daemonproxy.h b/app/daemonproxy.h new file mode 100644 index 0000000..7535b00 --- /dev/null +++ b/app/daemonproxy.h @@ -0,0 +1,66 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -a daemon/dbusadaptor -p app/daemonproxy daemon/org.pebbled.xml + * + * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef DAEMONPROXY_H_1404657374 +#define DAEMONPROXY_H_1404657374 + +#include <QtCore/QObject> +#include <QtCore/QByteArray> +#include <QtCore/QList> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QVariant> +#include <QtDBus/QtDBus> + +/* + * Proxy class for interface org.pebbled + */ +class OrgPebbledInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.pebbled"; } + +public: + OrgPebbledInterface(const QString &service = "org.pebbled", + const QString &path = "/", + const QDBusConnection &connection = QDBusConnection::sessionBus(), + QObject *parent = 0); + + ~OrgPebbledInterface(); + + Q_PROPERTY(QString address READ address) + inline QString address() const + { return qvariant_cast< QString >(property("address")); } + + Q_PROPERTY(bool connected READ connected) + inline bool connected() const + { return qvariant_cast< bool >(property("connected")); } + + Q_PROPERTY(QString name READ name) + inline QString name() const + { return qvariant_cast< QString >(property("name")); } + + Q_PROPERTY(QVariantMap pebble READ pebble) + inline QVariantMap pebble() const + { return qvariant_cast< QVariantMap >(property("pebble")); } + +public Q_SLOTS: // METHODS +Q_SIGNALS: // SIGNALS + void connectedChanged(); + void pebbleChanged(); +}; + +namespace org { + typedef ::OrgPebbledInterface pebbled; +} +#endif diff --git a/app/pebble.cpp b/app/pebble.cpp index 46e6298..623621d 100644 --- a/app/pebble.cpp +++ b/app/pebble.cpp @@ -32,14 +32,12 @@ #include <QtQuick> #include <sailfishapp.h> -#include "watchconnector.h" - -using namespace watch; +#include "daemonproxy.h" int main(int argc, char *argv[]) { - // Registert WatchController object on QML side - qmlRegisterType<WatchConnector>("watch", 0, 1, "WatchConnector"); + // Register Pebble daemon interface object on QML side + qmlRegisterType<org::pebbled>("org.pebbled", 0, 1, "PebbledInterface"); return SailfishApp::main(argc, argv); } |
