mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Fix previous commit.
This commit is contained in:
@@ -182,12 +182,12 @@ void Application::allTorrentsFinished()
|
||||
Preferences *const pref = Preferences::instance();
|
||||
|
||||
bool will_shutdown = (pref->shutdownWhenDownloadsComplete()
|
||||
|| pref->shutdownqBTWhenDownloadsComplete()
|
||||
|| pref->suspendWhenDownloadsComplete()
|
||||
|| pref->hibernateWhenDownloadsComplete());
|
||||
bool will_exit_only = pref->shutdownqBTWhenDownloadsComplete();
|
||||
|
||||
// Auto-Shutdown
|
||||
if (will_exit_only || will_shutdown) {
|
||||
if (will_shutdown) {
|
||||
bool suspend = pref->suspendWhenDownloadsComplete();
|
||||
bool hibernate = pref->hibernateWhenDownloadsComplete();
|
||||
bool shutdown = pref->shutdownWhenDownloadsComplete();
|
||||
@@ -201,20 +201,13 @@ void Application::allTorrentsFinished()
|
||||
else if (shutdown)
|
||||
action = ShutdownAction::Shutdown;
|
||||
|
||||
if (will_exit_only) {
|
||||
if (!pref->dontConfirmAutoExit()) {
|
||||
bool exitConfirmed = false;
|
||||
bool neverAskForExitConfirmationAgain = false;
|
||||
ShutdownConfirmDlg::askForConfirmation(action, &exitConfirmed, &neverAskForExitConfirmationAgain);
|
||||
if (neverAskForExitConfirmationAgain && exitConfirmed/*discard the request to never show again if dialog not accepted*/)
|
||||
pref->setDontConfirmAutoExit(true);
|
||||
if (!exitConfirmed) return;
|
||||
}
|
||||
if ((action == ShutdownAction::None) && (!pref->dontConfirmAutoExit())) {
|
||||
if (!ShutdownConfirmDlg::askForConfirmation(action))
|
||||
return;
|
||||
}
|
||||
else { //exit and shutdown
|
||||
bool shutdownConfirmed = false;
|
||||
ShutdownConfirmDlg::askForConfirmation(action, &shutdownConfirmed);
|
||||
if (!shutdownConfirmed) return;
|
||||
if (!ShutdownConfirmDlg::askForConfirmation(action))
|
||||
return;
|
||||
}
|
||||
|
||||
// Actually shut down
|
||||
|
||||
Reference in New Issue
Block a user