aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-11-14 12:14:03 -0500
committerKen Moore <ken@pcbsd.org>2014-11-14 12:14:03 -0500
commitf0e09f3d0fe234eb1748d7c6f94c6ddfc37fe6cc (patch)
tree1a58e7518a782df4a8ca78c6c4e56a185e02edb3 /libLumina/LuminaXDG.cpp
parentAdd detection/conversion of relative file paths to absolute file paths within... (diff)
downloadlumina-f0e09f3d0fe234eb1748d7c6f94c6ddfc37fe6cc.tar.gz
lumina-f0e09f3d0fe234eb1748d7c6f94c6ddfc37fe6cc.tar.bz2
lumina-f0e09f3d0fe234eb1748d7c6f94c6ddfc37fe6cc.zip
Update the XDG categories that are supported, as well as the add a new "Wine" category for internal recognition/use (since the wine apps do not usually list a category in the *.desktop file).
Diffstat (limited to 'libLumina/LuminaXDG.cpp')
-rw-r--r--libLumina/LuminaXDG.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp
index c5ceadfd..e7678d1f 100644
--- a/libLumina/LuminaXDG.cpp
+++ b/libLumina/LuminaXDG.cpp
@@ -88,6 +88,10 @@ XDGDesktop LXDG::loadDesktopFile(QString filePath, bool& ok){
if(!DF.showInList.isEmpty()){
DF.name.append(" ("+DF.showInList.join(", ")+")");
}
+ //Quick fix for showing "wine" applications (which quite often don't list a category)
+ if(DF.catList.isEmpty() && filePath.contains("/wine/")){
+ DF.catList << "Wine"; //Internal Lumina category only (not in XDG specs as of 11/14/14)
+ }
//Return the structure
ok=true;
return DF;
@@ -150,10 +154,11 @@ QStringList LXDG::systemApplicationDirs(){
out << appDirs[i]+"/applications";
//Also check any subdirs within this directory
// (looking at you KDE - stick to the standards!!)
- QDir dir(appDirs[i]+"/applications");
- QStringList subs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
+ out << LUtils::listSubDirectories(appDirs[i]+"/applications");
+ //QDir dir(appDirs[i]+"/applications");
+ //QStringList subs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
//qDebug() << "Adding subdirectories:" << appDirs[i]+"/applications/["+subs.join(", ")+"]";
- for(int s=0; s<subs.length(); s++){ out << dir.absoluteFilePath(subs[s]); }
+ //for(int s=0; s<subs.length(); s++){ out << dir.absoluteFilePath(subs[s]); }
}
}
return out;
@@ -185,7 +190,7 @@ QList<XDGDesktop> LXDG::systemDesktopFiles(bool showAll, bool showHidden){
QHash<QString,QList<XDGDesktop> > LXDG::sortDesktopCats(QList<XDGDesktop> apps){
//Sort the list of applications into their different categories (main categories only)
//Create the category lists
- QList<XDGDesktop> multimedia, dev, ed, game, graphics, network, office, science, settings, sys, utility, other;
+ QList<XDGDesktop> multimedia, dev, ed, game, graphics, network, office, science, settings, sys, utility, other, wine;
//Sort the apps into the lists
for(int i=0; i<apps.length(); i++){
if(apps[i].catList.contains("AudioVideo")){ multimedia << apps[i]; }
@@ -199,6 +204,7 @@ QHash<QString,QList<XDGDesktop> > LXDG::sortDesktopCats(QList<XDGDesktop> apps){
else if(apps[i].catList.contains("Settings")){ settings << apps[i]; }
else if(apps[i].catList.contains("System")){ sys << apps[i]; }
else if(apps[i].catList.contains("Utility")){ utility << apps[i]; }
+ else if(apps[i].catList.contains("Wine")){ wine << apps[i]; }
else{ other << apps[i]; }
}
//Now create the output hash
@@ -214,6 +220,7 @@ QHash<QString,QList<XDGDesktop> > LXDG::sortDesktopCats(QList<XDGDesktop> apps){
if(!settings.isEmpty()){ out.insert("Settings", LXDG::sortDesktopNames(settings)); }
if(!sys.isEmpty()){ out.insert("System", LXDG::sortDesktopNames(sys)); }
if(!utility.isEmpty()){ out.insert("Utility", LXDG::sortDesktopNames(utility)); }
+ if(!wine.isEmpty()){ out.insert("Wine", LXDG::sortDesktopNames(wine)); }
if(!other.isEmpty()){ out.insert("Unsorted", LXDG::sortDesktopNames(other)); }
//return the resulting hash
return out;
bgstack15