summaryrefslogtreecommitdiff
path: root/daemon/appmanager.h
blob: 7458e199aec694220081d394d988d02214133c4c (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
#ifndef APPMANAGER_H
#define APPMANAGER_H

#include <QObject>
#include <QHash>
#include <QUuid>
#include <QFileSystemWatcher>
#include <Log4Qt/Logger>
#include "appinfo.h"

class AppManager : public QObject
{
    Q_OBJECT
    LOG4QT_DECLARE_QCLASS_LOGGER

public:
    explicit AppManager(QObject *parent = 0);

    QStringList appPaths() const;

    AppInfo info(const QUuid &uuid) const;
    AppInfo info(const QString &shortName) const;

public slots:
    void rescan();

private:
    void scanApp(const QString &path);

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

#endif // APPMANAGER_H