summaryrefslogtreecommitdiff
path: root/daemon/appmanager.h
blob: 9fdb97756be64c8b46e5a5bcb3574101d5ea37a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;

    void insertAppInfo(const AppInfo &info);

public slots:
    void rescan();

signals:
    void appsChanged();

private:
    void scanApp(const QString &path);

private:
    QFileSystemWatcher *_watcher;
    QHash<QUuid, AppInfo> _apps;
    QHash<QString, QUuid> _names;
};

#endif // APPMANAGER_H