From eb27e089376031025d84e5235c44ff55e2118413 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 22 Aug 2016 13:18:38 -0400 Subject: Add some extra checks to the LuminaXDG application listing routine for when it was the first run or not. --- src-qt5/core/libLumina/LuminaXDG.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/libLumina') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index c53fa2ef..a714aa83 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -35,6 +35,7 @@ void XDGDesktopList::updateList(){ QStringList found, newfiles; //for avoiding duplicate apps (might be files with same name in different priority directories) QStringList oldkeys = files.keys(); bool appschanged = false; + bool firstrun = lastCheck.isNull() || oldkeys.isEmpty(); lastCheck = QDateTime::currentDateTime(); //Variables for internal loop use only (to prevent re-initializing variable on every iteration) bool ok; QString path; QDir dir; QStringList apps; XDGDesktop dFile; @@ -61,8 +62,8 @@ void XDGDesktopList::updateList(){ } //end loop over apps } //end loop over appDirs //Save the extra info to the internal lists - removedApps = oldkeys; //files which were removed - newApps = newfiles; //files which were added + if(!firstrun){ removedApps = oldkeys; }//files which were removed + if(!firstrun){ newApps = newfiles; }//files which were added //Now go through and cleanup any old keys where the associated file does not exist anymore for(int i=0; i