aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-08-18 12:27:54 -0400
committerKen Moore <moorekou@gmail.com>2016-08-18 12:27:54 -0400
commit91589889a2b97d9d73ed4e9023ef578d0a87f23c (patch)
tree25aed7b2a15f3981455b06a09b8db85c1be16fa3 /src-qt5/core
parentUpdate the new XDGDesktopList class a bit more: (diff)
downloadlumina-91589889a2b97d9d73ed4e9023ef578d0a87f23c.tar.gz
lumina-91589889a2b97d9d73ed4e9023ef578d0a87f23c.tar.bz2
lumina-91589889a2b97d9d73ed4e9023ef578d0a87f23c.zip
Adjust the XDGDesktopList static creation routine so that the static object itself can be accessed as needed.
Diffstat (limited to 'src-qt5/core')
-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