From 1b6183bfa3c918f876f0d8ad65adbf7c201aab88 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 19 Nov 2007 21:22:48 +0000 Subject: [PATCH] - BUGFIX: Saving trackers file only when necessary --- TODO | 1 + src/bittorrent.cpp | 3 +-- src/properties_imp.cpp | 4 ++++ src/properties_imp.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index d0a4c9132..436af96c1 100644 --- a/TODO +++ b/TODO @@ -59,3 +59,4 @@ rc8->final? changelog: - BUGFIX: Do no pause torrents before saving fastresume data anymore (no longer needed) - BUGFIX: Save fast resume data regularly (every 10 seconds) to avoid downloading from scratch if qBittorrent crashes - BUGFIX: Do not save fastresume data for checking torrents anymore +- BUGFIX: Saving trackers file only when necessary diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index e28eccfe9..06c20b822 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -858,8 +858,6 @@ void bittorrent::saveFastResumeAndRatioData() { } // Save ratio data saveDownloadUploadForTorrent(hash); - // Save trackers - saveTrackerFile(hash); } } qDebug("Fast resume and ratio data saved"); @@ -1005,6 +1003,7 @@ bool bittorrent::loadTrackerFile(QString hash) { } void bittorrent::saveTrackerFile(QString hash) { + qDebug("Saving tracker file for %s", hash.toUtf8().data()); QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); QFile tracker_file(torrentBackup.path()+QDir::separator()+ hash + ".trackers"); if(tracker_file.exists()) { diff --git a/src/properties_imp.cpp b/src/properties_imp.cpp index 0e7d643a8..90c82ff4d 100644 --- a/src/properties_imp.cpp +++ b/src/properties_imp.cpp @@ -489,6 +489,7 @@ void properties::askForTracker(){ h.force_reannounce(); // Reload Trackers loadTrackers(); + emit trackersChanged(h.hash()); } void properties::deleteSelectedUrlSeeds(){ @@ -537,6 +538,7 @@ void properties::deleteSelectedTrackers(){ h.force_reannounce(); // Reload Trackers loadTrackers(); + emit trackersChanged(h.hash()); } void properties::riseSelectedTracker(){ @@ -570,6 +572,7 @@ void properties::riseSelectedTracker(){ // Reload Trackers loadTrackers(); trackersURLS->item(i-1)->setSelected(true); + emit trackersChanged(h.hash()); } } @@ -604,6 +607,7 @@ void properties::lowerSelectedTracker(){ // Reload Trackers loadTrackers(); trackersURLS->item(i+1)->setSelected(true); + emit trackersChanged(h.hash()); } } diff --git a/src/properties_imp.h b/src/properties_imp.h index ec59479d3..c6a5659d1 100644 --- a/src/properties_imp.h +++ b/src/properties_imp.h @@ -80,6 +80,7 @@ class properties : public QDialog, private Ui::properties{ signals: void filteredFilesChanged(QString hash); void fileSizeChanged(QString hash); + void trackersChanged(QString hash); public: // Constructor