diff options
Diffstat (limited to 'daemon/appmanager.h')
| -rw-r--r-- | daemon/appmanager.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/daemon/appmanager.h b/daemon/appmanager.h new file mode 100644 index 0000000..e96ffe5 --- /dev/null +++ b/daemon/appmanager.h @@ -0,0 +1,42 @@ +#ifndef APPMANAGER_H +#define APPMANAGER_H + +#include <QObject> +#include <QHash> +#include <QUuid> +#include <QFileSystemWatcher> +#include <QLoggingCategory> +#include "appinfo.h" + +class AppManager : public QObject +{ + Q_OBJECT + QLoggingCategory l; + +public: + explicit AppManager(QObject *parent = 0); + + QStringList appPaths() const; + QList<QUuid> appUuids() const; + + AppInfo info(const QUuid &uuid) const; + AppInfo info(const QString &shortName) const; + +public slots: + void rescan(); + +signals: + void appsChanged(); + +private: + void scanApp(const QString &path); + QByteArray extractFromResourcePack(const QString &file, int id) const; + QImage decodeResourceImage(const QByteArray &data) const; + +private: + QFileSystemWatcher *_watcher; + QHash<QUuid, AppInfo> _apps; + QHash<QString, QUuid> _names; +}; + +#endif // APPMANAGER_H |
