diff options
-rw-r--r-- | lumina-desktop/LSession.cpp | 5 | ||||
-rw-r--r-- | lumina-open/main.cpp | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index e076210f..0fea2fa1 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -75,6 +75,7 @@ LSession::~LSession(){ void LSession::setupSession(){ qDebug() << "Initializing Session"; + if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); } QTime* timer = 0; if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();} //Seed random number generator (if needed) @@ -134,6 +135,8 @@ void LSession::CleanupSession(){ LSession::processEvents(); QDateTime time = QDateTime::currentDateTime(); qDebug() << "Start closing down the session: " << time.toString( Qt::SystemLocaleShortDate); + //Create a temporary flag to prevent crash dialogs from opening during cleanup + LUtils::writeFile("/tmp/.luminastopping",QStringList() << "yes", true); //Start the logout chimes (if necessary) bool playaudio = sessionsettings->value("PlayLogoutAudio",true).toBool(); if( playaudio ){ playAudioFile(LOS::LuminaShare()+"Logout.ogg"); } @@ -184,6 +187,8 @@ void LSession::CleanupSession(){ }else{ for(int i=0; i<20; i++){ LSession::processEvents(); usleep(25000); } //1/2 second pause } + //Clean up the temporary flag + if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); } //if(audioThread!=0){ audioThread->exit(0); } } diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index de7d137b..d0d2ced1 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -325,19 +325,19 @@ int main(int argc, char **argv){ } retcode = p->exitCode(); //qDebug() << "[lumina-open] Finished Cmd:" << cmd << retcode << p->exitStatus(); - + if( QFile::exists("/tmp/.luminastopping") ){ watch = false; } //closing down session - ignore "crashes" (app could have been killed during cleanup) if( (p->exitStatus() == QProcess::CrashExit || retcode > 0) && watch){ qDebug() << "[lumina-open] Application Error:" << retcode; QString err = QString(p->readAllStandardError()); if(err.isEmpty()){ err = QString(p->readAllStandardOutput()); } - //Setup the application - QApplication App(argc, argv); - LuminaThemeEngine theme(&App); - LUtils::LoadTranslation(&App,"lumina-open"); - QMessageBox dlg(QMessageBox::Critical, QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd ); - if(!err.isEmpty()){ dlg.setDetailedText(err); } - dlg.exec(); - } + //Setup the application + QApplication App(argc, argv); + LuminaThemeEngine theme(&App); + LUtils::LoadTranslation(&App,"lumina-open"); + QMessageBox dlg(QMessageBox::Critical, QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd ); + if(!err.isEmpty()){ dlg.setDetailedText(err); } + dlg.exec(); + } } return retcode; } |