aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp10
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index 78016029..338bfd15 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -501,6 +501,12 @@ QStringList LXDG::systemApplicationDirs(){
return out;
}
+XDGDesktopList* LXDG::systemAppsList(){
+ static XDGDesktopList sysapps(0,true); // = XDGDesktopList(0,true); //set this to automatically update as needed
+ if(sysapps.lastCheck.isNull()){ sysapps.updateList(); } //catch the first time the class was used, and prompt for an update right now
+ return &sysapps;
+}
+
QList<XDGDesktop> LXDG::systemDesktopFiles(bool showAll, bool showHidden){
//Returns a list of all the unique *.desktop files that were found
/*qDebug() << "Read System Apps:";
@@ -526,9 +532,7 @@ QList<XDGDesktop> LXDG::systemDesktopFiles(bool showAll, bool showHidden){
qDebug() << " End:" << QDateTime::currentDateTime().toString("hh.mm.ss.zzz");
//return out; */
//qDebug() << "New Routine Start:" << QDateTime::currentDateTime().toString("hh.mm.ss.zzz");
- static XDGDesktopList sysappslist;
- sysappslist.updateList();
- return sysappslist.apps(showAll, showHidden);
+ return systemAppsList()->apps(showAll, showHidden);
//qDebug() << " End:" << QDateTime::currentDateTime().toString("hh.mm.ss.zzz");
//return out;
}
diff --git a/src-qt5/core/libLumina/LuminaXDG.h b/src-qt5/core/libLumina/LuminaXDG.h
index 376fc86a..887aa920 100644
--- a/src-qt5/core/libLumina/LuminaXDG.h
+++ b/src-qt5/core/libLumina/LuminaXDG.h
@@ -147,7 +147,8 @@ public:
//Get a list of all the directories where *.desktop files exist
static QStringList systemApplicationDirs();
//Get a list of all the *.desktop files available on the system
- static QList<XDGDesktop> systemDesktopFiles(bool showAll = false, bool showHidden = false);
+ static XDGDesktopList* systemAppsList(); //return a pointer to the entire class
+ static QList<XDGDesktop> systemDesktopFiles(bool showAll = false, bool showHidden = false); //simplification for getting just the files
//Sort a list of Desktop files into the proper categories
static QHash< QString, QList<XDGDesktop> > sortDesktopCats(QList<XDGDesktop> apps);
//Return the icon to use for the given category
bgstack15