diff options
author | Ken Moore <moorekou@gmail.com> | 2016-08-18 12:06:54 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-08-18 12:06:54 -0400 |
commit | 045210068cdbb1ff9d2d0d70a6910839ca42558b (patch) | |
tree | c7d6dcca4e124159eeb91719c25008c1e438b58e /src-qt5/core/libLumina/LuminaXDG.h | |
parent | Revamp how the system applications are parsed/updated. (diff) | |
download | lumina-045210068cdbb1ff9d2d0d70a6910839ca42558b.tar.gz lumina-045210068cdbb1ff9d2d0d70a6910839ca42558b.tar.bz2 lumina-045210068cdbb1ff9d2d0d70a6910839ca42558b.zip |
Update the new XDGDesktopList class a bit more:
1) Add in all the bits to make it auto-update as needed (optional init argument)
2) Have it also keep track of what previous files were *removed* when it updates.
3) Tweak the update routine to try and make it even faster.
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.h')
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h index 644ec65a..376fc86a 100644 --- a/src-qt5/core/libLumina/LuminaXDG.h +++ b/src-qt5/core/libLumina/LuminaXDG.h @@ -18,6 +18,7 @@ #define _LUMINA_LIBRARY_XDG_H #include <QFile> +#include <QFileSystemWatcher> #include <QDir> #include <QFileInfo> #include <QStringList> @@ -72,20 +73,27 @@ public: // ======================== // Data Structure for keeping track of known system applications // ======================== -class XDGDesktopList{ +class XDGDesktopList : public QObject{ + Q_OBJECT public: + //Functions + XDGDesktopList(QObject *parent = 0, bool watchdirs = false); + ~XDGDesktopList(); + //Main Interface functions + QList<XDGDesktop> apps(bool showAll, bool showHidden); //showAll: include invalid files, showHidden: include NoShow/Hidden files + //Administration variables (not typically used directly) QDateTime lastCheck; - QStringList newApps; //list of "new" apps found during the last check + QStringList newApps, removedApps; //list of "new/removed" apps found during the last check QHash<QString, XDGDesktop> files; //<filepath>/<XDGDesktop structure> - //Functions - XDGDesktopList(){} - ~XDGDesktopList(){} - //Main Interface functions +public slots: void updateList(); //run the check routine - QList<XDGDesktop> apps(bool showAll, bool showHidden); //showAll: include invalid files, showHidden: include NoShow/Hidden files +private: + QFileSystemWatcher *watcher; +signals: + void appsUpdated(); }; // ======================== |