aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaXDG.cpp
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/libLumina/LuminaXDG.cpp
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/libLumina/LuminaXDG.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp10
1 files changed, 7 insertions, 3 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;
}
bgstack15