|
|
@ -2048,7 +2048,6 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Move to download directory if necessary
|
|
|
|
// Move to download directory if necessary
|
|
|
|
if(!defaultTempPath.isEmpty()) { |
|
|
|
if(!defaultTempPath.isEmpty()) { |
|
|
|
// Check if directory is different
|
|
|
|
// Check if directory is different
|
|
|
@ -2057,6 +2056,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { |
|
|
|
if(current_dir != save_dir) { |
|
|
|
if(current_dir != save_dir) { |
|
|
|
h.move_storage(save_dir.absolutePath()); |
|
|
|
h.move_storage(save_dir.absolutePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// Remember finished state
|
|
|
|
// Remember finished state
|
|
|
|
TorrentPersistentData::saveSeedStatus(h); |
|
|
|
TorrentPersistentData::saveSeedStatus(h); |
|
|
|
// Recheck if the user asked to
|
|
|
|
// Recheck if the user asked to
|
|
|
@ -2065,7 +2065,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { |
|
|
|
} |
|
|
|
} |
|
|
|
emit finishedTorrent(h); |
|
|
|
emit finishedTorrent(h); |
|
|
|
qDebug("Received finished alert for %s", qPrintable(h.name())); |
|
|
|
qDebug("Received finished alert for %s", qPrintable(h.name())); |
|
|
|
bool will_shutdown = Preferences::shutdownWhenDownloadsComplete() && !hasDownloadingTorrents(); |
|
|
|
bool will_shutdown = (Preferences::shutdownWhenDownloadsComplete() || Preferences::shutdownqBTWhenDownloadsComplete()) |
|
|
|
|
|
|
|
&& !hasDownloadingTorrents(); |
|
|
|
// AutoRun program
|
|
|
|
// AutoRun program
|
|
|
|
if(Preferences::isAutoRunEnabled()) |
|
|
|
if(Preferences::isAutoRunEnabled()) |
|
|
|
autoRunExternalProgram(h, will_shutdown); |
|
|
|
autoRunExternalProgram(h, will_shutdown); |
|
|
@ -2074,6 +2075,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { |
|
|
|
sendNotificationEmail(h); |
|
|
|
sendNotificationEmail(h); |
|
|
|
// Auto-Shutdown
|
|
|
|
// Auto-Shutdown
|
|
|
|
if(will_shutdown) { |
|
|
|
if(will_shutdown) { |
|
|
|
|
|
|
|
if(Preferences::shutdownWhenDownloadsComplete()) { |
|
|
|
qDebug("Preparing for auto-shutdown because all downloads are complete!"); |
|
|
|
qDebug("Preparing for auto-shutdown because all downloads are complete!"); |
|
|
|
#if LIBTORRENT_VERSION_MINOR < 15 |
|
|
|
#if LIBTORRENT_VERSION_MINOR < 15 |
|
|
|
saveDHTEntry(); |
|
|
|
saveDHTEntry(); |
|
|
@ -2084,6 +2086,7 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { |
|
|
|
saveFastResumeData(); |
|
|
|
saveFastResumeData(); |
|
|
|
qDebug("Sending computer shutdown signal"); |
|
|
|
qDebug("Sending computer shutdown signal"); |
|
|
|
misc::shutdownComputer(); |
|
|
|
misc::shutdownComputer(); |
|
|
|
|
|
|
|
} |
|
|
|
qDebug("Exiting the application"); |
|
|
|
qDebug("Exiting the application"); |
|
|
|
qApp->exit(); |
|
|
|
qApp->exit(); |
|
|
|
return; |
|
|
|
return; |
|
|
|