diff options
author | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-25 12:13:31 +0200 |
---|---|---|
committer | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-25 12:13:31 +0200 |
commit | 1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 (patch) | |
tree | 8c491cd196e2eff4c59f8c23f566f7ff26981586 /src/lib/xdgentries.h |
Initial Commit
Diffstat (limited to 'src/lib/xdgentries.h')
-rw-r--r-- | src/lib/xdgentries.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/xdgentries.h b/src/lib/xdgentries.h new file mode 100644 index 0000000..fd0458a --- /dev/null +++ b/src/lib/xdgentries.h @@ -0,0 +1,41 @@ +#ifndef XDGENTRIES_H +#define XDGENTRIES_H + +#include <QObject> +#include <QFileSystemWatcher> +#include <QMap> + +namespace xdg { + class Entry; + + class Entries : public QObject + { + Q_OBJECT + QString m_type; + QFileSystemWatcher m_watcher; + QMap<QString, xdg::Entry*> m_entries; + + private slots: + void _directoryChanged(const QString &path); + void _entryDataChanged(const QString key, const QString value); + + public: + explicit Entries(QObject *parent = nullptr); + void unregister(const QString &path); + int add(const QString &path, bool replace = false); + int addDirectory(const QString &path, bool replace = false); + qsizetype count() const; + const Entry *getEntry(int i) const; + QList<xdg::Entry *> getEntries(); + + signals: + void entryDataChanged(const QString appid, const QString key, const QString value); + void raiseProcess(int pid); + void startCreateEntry(int id); + void endCreateEntry(int id); + void startRemoveEntry(int id); + void endRemoveEntry(int id); + }; +} + +#endif // XDGENTRIES_H |