From f54f49edaf06afa7f9e09b12a30649096991ac10 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 24 Feb 2017 11:03:58 -0500 Subject: Quick fix for the "Directory" XDG desktop type detection/verification. --- src-qt5/core/libLumina/LuminaXDG.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index d92285c5..38128fc7 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -127,9 +127,8 @@ void XDGDesktop::sync(){ else if(var=="Type" && insection){ if(val.toLower()=="application"){ type = XDGDesktop::APP; } else if(val.toLower()=="link"){ type = XDGDesktop::LINK; } - else if(val.toLower()=="dir"){ type = XDGDesktop::DIR; } + else if(val.toLower().startsWith("dir")){ type = XDGDesktop::DIR; } //older specs are "Dir", newer specs are "Directory" else{ type = XDGDesktop::BAD; } //Unknown type - //hasType = true; } } //end reading file file.clear(); //done with contents of file @@ -176,7 +175,7 @@ bool XDGDesktop::isValid(bool showAll){ //if(DEBUG && !ok){ qDebug() << " - Link with missing URL"; } break; case XDGDesktop::DIR: - ok = !path.isEmpty(); + ok = !path.isEmpty() && QFile::exists(path); //if(DEBUG && !ok){ qDebug() << " - Dir with missing path"; } break; default: -- cgit From 7e00d31d1dcb444869512710ad2af5055834b028 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 27 Feb 2017 11:58:42 -0500 Subject: Clean up a couple more compile warnings about unused variables. --- src-qt5/core/libLumina/LuminaXDG.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 38128fc7..cbc90f25 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -476,7 +476,7 @@ void XDGDesktopList::updateList(){ 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; + QString path; QDir dir; QStringList apps; for(int i=0; ilastRead>QFileInfo(path).lastModified()) ){ //Re-use previous data for this file (nothing changed) found << files[path]->name; //keep track of which files were already found - ok=true; }else{ - ok=false; - if(files.contains(path)){ appschanged = true; files.take(path)->deleteLater(); } //files.remove(path); } - XDGDesktop *dFile = new XDGDesktop(path, this); //will change the "ok" variable as needed + if(files.contains(path)){ appschanged = true; files.take(path)->deleteLater(); } + XDGDesktop *dFile = new XDGDesktop(path, this); if(dFile->type!=XDGDesktop::BAD){ appschanged = true; //flag that something changed - needed to load a file if(!oldkeys.contains(path)){ newfiles << path; } //brand new file (not an update to a previously-read file) -- cgit