aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-04-24 18:00:14 -0400
committerKen Moore <ken@ixsystems.com>2018-04-24 18:00:14 -0400
commit2a662f7898806857378540e270460b0c3212f1fd (patch)
tree1600c51adeac90c4db999916c1c50f8bc097cd08
parentAdd a bunch more ZFS integrations into LFileInfo: (diff)
downloadlumina-2a662f7898806857378540e270460b0c3212f1fd.tar.gz
lumina-2a662f7898806857378540e270460b0c3212f1fd.tar.bz2
lumina-2a662f7898806857378540e270460b0c3212f1fd.zip
Fix up the audio chimes routines:
1. Ensure that reading the file to be used for the chime is done correctly. 2. Ensure that the session does not crash during cleanup if the exit chime could not be played. 3. Ensure that the default audio chime files are used if nothing else is specified/valid in the settings.
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index fe399e40..5de7850a 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -205,7 +205,8 @@ void LSession::CleanupSession(){
if(vol>=0){ sessionsettings->setValue("last_session_state/audio_volume", vol); }
bool playaudio = sessionsettings->value("PlayLogoutAudio",true).toBool();
if( playaudio ){
- QString sfile = sessionsettings->value("audiofiles/logout", LOS::LuminaShare()+"Logout.ogg").toString();
+ QString sfile = sessionsettings->value("audiofiles/logout", "").toString();
+ if(sfile.isEmpty() || !QFile::exists(sfile)){ sfile = LOS::LuminaShare()+"Logout.ogg"; }
playAudioFile(sfile);
}
//Stop the background system tray (detaching/closing apps as necessary)
@@ -242,7 +243,7 @@ void LSession::CleanupSession(){
// this will leave the wallpapers up for a few moments (preventing black screens)
}
//Now wait a moment for things to close down before quitting
- if(playaudio){
+ if(playaudio && mediaObj!=0){
//wait a max of 5 seconds for audio to finish
bool waitmore = true;
for(int i=0; i<100 && waitmore; i++){
@@ -312,7 +313,8 @@ void LSession::launchStartupApps(){
//Now play the login music since we are finished
if(sessionsettings->value("PlayStartupAudio",true).toBool()){
- QString sfile = sessionsettings->value("audiofiles/login", LOS::LuminaShare()+"Login.ogg").toString();
+ QString sfile = sessionsettings->value("audiofiles/login", "").toString();
+ if(sfile.isEmpty() || !QFile::exists(sfile)){ sfile = LOS::LuminaShare()+"Login.ogg"; }
playAudioFile(sfile);
}
//qDebug() << "[DESKTOP INIT FINISHED]";
bgstack15