diff options
Diffstat (limited to 'lumina-desktop/LSession.cpp')
-rw-r--r-- | lumina-desktop/LSession.cpp | 35 |
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"); |