From 1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 Mon Sep 17 00:00:00 2001 From: Fabien Proriol Date: Sun, 25 May 2025 12:13:31 +0200 Subject: Initial Commit --- src/lib/xdgentries.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/lib/xdgentries.h (limited to 'src/lib/xdgentries.h') 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 +#include +#include + +namespace xdg { + class Entry; + + class Entries : public QObject + { + Q_OBJECT + QString m_type; + QFileSystemWatcher m_watcher; + QMap 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 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 -- cgit v1.2.3