diff options
| author | Javier <dev.git@javispedro.com> | 2014-11-30 17:27:08 +0100 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2014-11-30 17:37:19 +0100 |
| commit | 49f1261bf9d635d5e3d881e87a93ed4e76abfe90 (patch) | |
| tree | 4432ecd771a3aca533914d02f9947cb497493395 /daemon/appmanager.h | |
| parent | d55d1d472d5876f90dd95301d9f3b6bef6f4c494 (diff) | |
allow receiving responses to commands in watchconnector
* the skeleton is in place for watchconnector to allow query->response
messages. I've used call/cc style because it is impossible to make
QBluetoothSocket synchronous (waitForReadyRead() is a no-op)
* remove watchcommands, instead create musicmanager to listen for the
music endpoint. The other (simpler) endpoints are now listened in
watchconnector itself. hangupAll() slot is moved to voicecallmanager.
* instead of emitting signals for each received message, listeners
can now register for receiving messages targeted towards a given
endpoint
* when reading from bluetoothsocket, properly handle short reads
* remove useless 'watch' namespace
* create appmanager, which mantains a database of installed apps
(installed on the phone, that is; watch installed apps will come
later)
* all the *Managers are now instantiated by the main Manager itself
* introduce Unpacker helper class for decoding watch messages
* implement getAppbankStatus and getAppbankUuids messages and response
parsers
* remove file logging for now (20MB is bad for eMMC!)
* use dbus object path /org/pebbled instead of /
Diffstat (limited to 'daemon/appmanager.h')
| -rw-r--r-- | daemon/appmanager.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/daemon/appmanager.h b/daemon/appmanager.h index 59d0bd7..5e150ab 100644 --- a/daemon/appmanager.h +++ b/daemon/appmanager.h @@ -2,19 +2,46 @@ #define APPMANAGER_H #include <QObject> +#include <QHash> +#include <QUuid> +#include <QFileSystemWatcher> +#include <Log4Qt/Logger> class AppManager : public QObject { Q_OBJECT + LOG4QT_DECLARE_QCLASS_LOGGER public: explicit AppManager(QObject *parent = 0); + struct AppInfo { + QUuid uuid; + QString shortName; + QString longName; + QString company; + int versionCode; + QString versionLabel; + bool isWatchface; + bool isJSKit; + QHash<QString, int> appKeys; + QString path; + }; + + QStringList appPaths() const; + bool installPebbleApp(const QString &pbwFile); - QList<QUuid> allInstalledApps() const; +public slots: + void rescan(); + +private: + void scanApp(const QString &path); - QString getAppDir(const QUuid &uuid) const; +private: + QFileSystemWatcher *_watcher; + QHash<QUuid, AppInfo> _apps; + QHash<QString, QUuid> _names; }; #endif // APPMANAGER_H |
