From 1c320661dbdad0a48e4000f0aa3fedc3f1877878 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 30 Mar 2015 09:45:46 -0400 Subject: Add usage support for the XDG autostart specifications. This is currently on top of the older Lumina autostart specification, until I can get the writing support for the XDG spec in place as well - at which time I will convert any Lumina-spec entries to the XDG spec (for backwards compat). --- libLumina/LuminaXDG.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++-- libLumina/LuminaXDG.h | 3 +++ 2 files changed, 61 insertions(+), 2 deletions(-) (limited to 'libLumina') diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp index e4839480..dbf08b88 100644 --- a/libLumina/LuminaXDG.cpp +++ b/libLumina/LuminaXDG.cpp @@ -127,8 +127,8 @@ bool LXDG::checkValidity(XDGDesktop dFile, bool showAll){ if(DEBUG){ qDebug() << " - Unknown file type"; } } if(!showAll){ - if(!dFile.showInList.isEmpty()){ ok = dFile.showInList.contains("Lumina"); } - else if(!dFile.notShowInList.isEmpty()){ ok = !dFile.notShowInList.contains("Lumina"); } + if(!dFile.showInList.isEmpty()){ ok = dFile.showInList.contains("Lumina", Qt::CaseInsensitive); } + else if(!dFile.notShowInList.isEmpty()){ ok = !dFile.notShowInList.contains("Lumina",Qt::CaseInsensitive); } } return ok; } @@ -665,3 +665,59 @@ QStringList LXDG::loadMimeFileGlobs2(){ return mimeglobs; } +//Find all the autostart *.desktop files +QList LXDG::findAutoStartFiles(bool includeInvalid){ + + //First get the list of directories to search (system first, user-provided files come later and overwrite sys files as needed) + QStringList paths = QString(getenv("XDG_CONFIG_DIRS")).split(":"); + paths << QString(getenv("XDG_CONFIG_HOME")).split(":"); + //Now go through them and find any valid *.desktop files + QList files; + QStringList filenames; //make it easy to see if this filename is an override + QDir dir; + for(int i=0;i findAutoStartFiles(bool includeInvalid = false); }; #endif -- cgit