mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
Remember completion date correctly
This commit is contained in:
parent
53d9817d8a
commit
c9c2ab320d
2 changed files with 16 additions and 16 deletions
|
@ -2016,7 +2016,6 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||
if (torrent_finished_alert* p = dynamic_cast<torrent_finished_alert*>(a.get())) {
|
||||
QTorrentHandle h(p->handle);
|
||||
if(h.is_valid()) {
|
||||
emit finishedTorrent(h);
|
||||
const QString hash = h.hash();
|
||||
#if LIBTORRENT_VERSION_MINOR > 14
|
||||
// Remove .!qB extension if necessary
|
||||
|
@ -2057,18 +2056,14 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
|
|||
if(current_dir != save_dir) {
|
||||
h.move_storage(save_dir.absolutePath());
|
||||
}
|
||||
}
|
||||
// Remember finished state
|
||||
TorrentPersistentData::saveSeedStatus(h);
|
||||
// Recheck if the user asked to
|
||||
if(Preferences::recheckTorrentsOnCompletion() && !was_already_seeded) {
|
||||
// Remember finished state
|
||||
TorrentPersistentData::saveSeedStatus(h);
|
||||
if(Preferences::recheckTorrentsOnCompletion()) {
|
||||
h.force_recheck();
|
||||
} else {
|
||||
// Remember finished state
|
||||
TorrentPersistentData::saveSeedStatus(h);
|
||||
}
|
||||
emit finishedTorrent(h);
|
||||
qDebug("Received finished alert for %s", qPrintable(h.name()));
|
||||
if(!was_already_seeded) {
|
||||
bool will_shutdown = Preferences::shutdownWhenDownloadsComplete() && !hasDownloadingTorrents();
|
||||
// AutoRun program
|
||||
if(Preferences::isAutoRunEnabled())
|
||||
|
|
|
@ -375,12 +375,17 @@ public:
|
|||
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume"));
|
||||
QHash<QString, QVariant> all_data = settings.value("torrents", QHash<QString, QVariant>()).toHash();
|
||||
QHash<QString, QVariant> data = all_data[h.hash()].toHash();
|
||||
data["seed"] = h.is_seed();
|
||||
bool was_seed = data.value("seed", false).toBool();
|
||||
if(was_seed != h.is_seed()) {
|
||||
data["seed"] = !was_seed;
|
||||
all_data[h.hash()] = data;
|
||||
settings.setValue("torrents", all_data);
|
||||
if(!was_seed) {
|
||||
// Save completion date
|
||||
saveSeedDate(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
static QString getSavePath(QString hash) {
|
||||
|
|
Loading…
Reference in a new issue