aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-28 14:52:41 -0500
committerKen Moore <ken@pcbsd.org>2015-01-28 14:52:41 -0500
commit5edb81a6136e734ff47f04787e055dc7b8f5b260 (patch)
treee238486638e4449e3d7dab1d2c04981796c0d34b
parentMerge pull request #43 from Nanolx/luminaos-debian (diff)
downloadlumina-5edb81a6136e734ff47f04787e055dc7b8f5b260.tar.gz
lumina-5edb81a6136e734ff47f04787e055dc7b8f5b260.tar.bz2
lumina-5edb81a6136e734ff47f04787e055dc7b8f5b260.zip
Clean up how Lumina loads the startapps files. Now it will combine any files that are found, allowing for system-wide defaults in addition to user-set defaults.NOTE: all the system files are named "luminaStartapps" whereas the file in the user's config is "~/.lumina/startapps"
-rw-r--r--lumina-desktop/LSession.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index 34ca9eec..7016a2b7 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -144,30 +144,35 @@ void LSession::setupSession(){
void LSession::launchStartupApps(){
//First start any system-defined startups, then do user defined
qDebug() << "Launching startup applications";
- QString startfile;
- if(QFile::exists("/etc/luminaStartapps")) {
- startfile = "/etc/luminaStartapps";
- } else if (QFile::exists(QDir::homePath()+"/.lumina/startapps")) {
- startfile = QDir::homePath()+"/.lumina/startapps";
- } else if (QFile::exists(LOS::LuminaShare()+"startapps")) {
- startfile = LOS::LuminaShare()+"startapps";
- }
-
- if(!startfile.isEmpty()) {
- QFile file(startfile);
+ //First create the list of all possible locations in order of precedence
+ // NOTE: Lumina/system defaults should be launched earlier due to possible system admin utilities
+ QStringList filelist;
+ filelist << LOS::LuminaShare()+"startapps"; //anything special for the Lumina installation
+ filelist << "/etc/luminaStartapps" << LOS::SysPrefix()+"luminaStartapps" << LOS::AppPrefix()+"luminaStartapps"; //System defaults
+ filelist << QDir::homePath()+"/.lumina/startapps"; //User defaults
+ filelist.removeDuplicates(); //just in case sysPrefix/appPrefix/etc are the same
+ //Now load all the available files
+ QStringList entries; //where to save good entries
+ for(int i=0; i<filelist.length(); i++){
+ if( !QFile::exists(filelist[i]) ){ continue; } //file does not exist
+ QFile file(filelist[i]);
if( file.open(QIODevice::ReadOnly | QIODevice::Text) ){
QTextStream in(&file);
while(!in.atEnd()){
QString entry = in.readLine();
if(entry.startsWith("#") || entry.isEmpty()){ continue; }
- //Might put other sanity checks here
- qDebug() << " - Starting Application:" << entry;
- LSession::LaunchApplication(entry);
+ entries << entry;
}
file.close();
}
}
-
+ //Now start all the listed apps
+ entries.removeDuplicates(); //Just in case something is duplicated between system/user defaults
+ for(int i=0; i<entries.length(); i++){
+ qDebug() << " - Starting Application:" << entries[i];
+ LSession::LaunchApplication(entries[i]);
+ }
+
//Now play the login music
if(sessionsettings->value("PlayStartupAudio",true).toBool()){
LSession::playAudioFile(LOS::LuminaShare()+"Login.ogg");
bgstack15