|
|
@ -995,7 +995,10 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f |
|
|
|
loadTorrentSettings(h); |
|
|
|
loadTorrentSettings(h); |
|
|
|
|
|
|
|
|
|
|
|
// Load filtered files
|
|
|
|
// Load filtered files
|
|
|
|
|
|
|
|
bool add_paused = pref->addTorrentsInPause(); |
|
|
|
if (!resumed) { |
|
|
|
if (!resumed) { |
|
|
|
|
|
|
|
if (TorrentTempData::hasTempData(hash)) |
|
|
|
|
|
|
|
add_paused = TorrentTempData::isAddPaused(hash); |
|
|
|
loadTorrentTempData(h, savePath, true); |
|
|
|
loadTorrentTempData(h, savePath, true); |
|
|
|
} |
|
|
|
} |
|
|
|
if (HiddenData::hasData(hash) && pref->isQueueingSystemEnabled()) { |
|
|
|
if (HiddenData::hasData(hash) && pref->isQueueingSystemEnabled()) { |
|
|
@ -1014,7 +1017,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f |
|
|
|
s->set_settings(sessionSettings); |
|
|
|
s->set_settings(sessionSettings); |
|
|
|
h.queue_position_top(); |
|
|
|
h.queue_position_top(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!pref->addTorrentsInPause() || HiddenData::hasData(hash)) { |
|
|
|
if (!add_paused || HiddenData::hasData(hash)) { |
|
|
|
// Start torrent because it was added in paused state
|
|
|
|
// Start torrent because it was added in paused state
|
|
|
|
h.resume(); |
|
|
|
h.resume(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1182,8 +1185,12 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr |
|
|
|
|
|
|
|
|
|
|
|
loadTorrentSettings(h); |
|
|
|
loadTorrentSettings(h); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool add_paused = pref->addTorrentsInPause(); |
|
|
|
if (!resumed) { |
|
|
|
if (!resumed) { |
|
|
|
qDebug("This is a NEW torrent (first time)..."); |
|
|
|
qDebug("This is a NEW torrent (first time)..."); |
|
|
|
|
|
|
|
if (TorrentTempData::hasTempData(hash)) |
|
|
|
|
|
|
|
add_paused = TorrentTempData::isAddPaused(hash); |
|
|
|
|
|
|
|
|
|
|
|
loadTorrentTempData(h, savePath, false); |
|
|
|
loadTorrentTempData(h, savePath, false); |
|
|
|
|
|
|
|
|
|
|
|
// Append .!qB to incomplete files
|
|
|
|
// Append .!qB to incomplete files
|
|
|
@ -1199,7 +1206,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr |
|
|
|
exportTorrentFile(h); |
|
|
|
exportTorrentFile(h); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!fastResume && !pref->addTorrentsInPause()) { |
|
|
|
if (!fastResume && !add_paused) { |
|
|
|
// Start torrent because it was added in paused state
|
|
|
|
// Start torrent because it was added in paused state
|
|
|
|
h.resume(); |
|
|
|
h.resume(); |
|
|
|
} |
|
|
|
} |
|
|
@ -2912,10 +2919,7 @@ void QBtSession::processDownloadedFile(QString url, QString file_path) { |
|
|
|
emit newDownloadedTorrent(file_path, url); |
|
|
|
emit newDownloadedTorrent(file_path, url); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
url_skippingDlg.removeAt(index); |
|
|
|
url_skippingDlg.removeAt(index); |
|
|
|
QTorrentHandle h = addTorrent(file_path, false, url, false); |
|
|
|
addTorrent(file_path, false, url, false); |
|
|
|
// Pause torrent if necessary
|
|
|
|
|
|
|
|
if (h.is_valid() && pref->addTorrentsInPause() && pref->useAdditionDialog()) |
|
|
|
|
|
|
|
h.pause(); |
|
|
|
|
|
|
|
emit newDownloadedTorrentFromRss(url); |
|
|
|
emit newDownloadedTorrentFromRss(url); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -3093,6 +3097,11 @@ void QBtSession::unhideMagnet(const QString &hash) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool add_paused = pref->addTorrentsInPause(); |
|
|
|
|
|
|
|
if (TorrentTempData::hasTempData(hash)) { |
|
|
|
|
|
|
|
add_paused = TorrentTempData::isAddPaused(hash); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!h.has_metadata()) { |
|
|
|
if (!h.has_metadata()) { |
|
|
|
if (pref->isQueueingSystemEnabled()) { |
|
|
|
if (pref->isQueueingSystemEnabled()) { |
|
|
|
//Internally decrease the queue limits to ensure that other queued items aren't started
|
|
|
|
//Internally decrease the queue limits to ensure that other queued items aren't started
|
|
|
@ -3109,13 +3118,13 @@ void QBtSession::unhideMagnet(const QString &hash) { |
|
|
|
sessionSettings.active_limit = max_active; |
|
|
|
sessionSettings.active_limit = max_active; |
|
|
|
s->set_settings(sessionSettings); |
|
|
|
s->set_settings(sessionSettings); |
|
|
|
} |
|
|
|
} |
|
|
|
if (pref->addTorrentsInPause()) |
|
|
|
if (add_paused) |
|
|
|
h.pause(); |
|
|
|
h.pause(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
h.queue_position_bottom(); |
|
|
|
h.queue_position_bottom(); |
|
|
|
loadTorrentTempData(h, h.save_path(), !h.has_metadata()); //TempData are deleted by a call to TorrentPersistentData::saveTorrentPersistentData()
|
|
|
|
loadTorrentTempData(h, h.save_path(), !h.has_metadata()); //TempData are deleted by a call to TorrentPersistentData::saveTorrentPersistentData()
|
|
|
|
if (!pref->addTorrentsInPause()) |
|
|
|
if (!add_paused) |
|
|
|
h.resume(); |
|
|
|
h.resume(); |
|
|
|
h.move_storage(save_path); |
|
|
|
h.move_storage(save_path); |
|
|
|
|
|
|
|
|
|
|
|