Corrected an other regression introduced in r2826: exit when playing and fadeout is disable

This commit is contained in:
Arnaud Bienner 2011-02-16 23:44:03 +00:00
parent 0f1a1cc332
commit 6d8c87418a
1 changed files with 10 additions and 8 deletions

View File

@ -1753,13 +1753,15 @@ bool MainWindow::winEvent(MSG* msg, long*) {
#endif // Q_OS_WIN32
void MainWindow::Exit() {
// To shut down the application when fadeout will be finished
connect(player_->engine(), SIGNAL(FadeoutFinishedSignal()), qApp, SLOT(quit()));
if(player_->GetState() == Engine::Playing) {
player_->Stop();
hide();
tray_icon_->SetVisible(false);
} else {
qApp->quit();
if(player_->engine()->is_fadeout_enabled()) {
// To shut down the application when fadeout will be finished
connect(player_->engine(), SIGNAL(FadeoutFinishedSignal()), qApp, SLOT(quit()));
if(player_->GetState() == Engine::Playing) {
player_->Stop();
hide();
tray_icon_->SetVisible(false);
return; // Don't quit the application now: wait for the fadeout finished signal
}
}
qApp->quit();
}