diff --git a/Changelog b/Changelog index 32f68c2d5..734b05a75 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ - BUGFIX: Remember the current property tab on startup - BUGFIX: Fix status list widget height issue on style change - BUGFIX: Fix rounding issue in torrent progress display + - BUGFIX: Fix issue when altering files priorities of a seeding torrent * Tue Oct 19 2010 - Christophe Dumez - v2.4.7 - BUGFIX: Display the priority column when the queueing system gets enabled diff --git a/src/qtorrenthandle.cpp b/src/qtorrenthandle.cpp index 2377a21bc..36528cfa5 100644 --- a/src/qtorrenthandle.cpp +++ b/src/qtorrenthandle.cpp @@ -585,6 +585,14 @@ void QTorrentHandle::prioritize_files(const std::vector &v) { if(was_seed && !is_seed()) { // Reset seed status TorrentPersistentData::saveSeedStatus(*this); + // Move to temp folder if necessary + if(Preferences::isTempPathEnabled()) { + QString tmp_path = Preferences::getTempPath(); + QString root_folder = TorrentPersistentData::getRootFolder(hash()); + if(!root_folder.isEmpty()) + tmp_path = QDir(tmp_path).absoluteFilePath(root_folder); + move_storage(tmp_path); + } } } @@ -656,10 +664,21 @@ void QTorrentHandle::move_storage(QString new_path) const { } void QTorrentHandle::file_priority(int index, int priority) const { - Q_ASSERT(h.is_valid()); + Q_ASSERT(torrent_handle::is_valid()); + bool was_seed = is_seed(); h.file_priority(index, priority); - // Save seed status - TorrentPersistentData::saveSeedStatus(*this); + if(was_seed && !is_seed()) { + // Save seed status + TorrentPersistentData::saveSeedStatus(*this); + // Move to temp folder if necessary + if(Preferences::isTempPathEnabled()) { + QString tmp_path = Preferences::getTempPath(); + QString root_folder = TorrentPersistentData::getRootFolder(hash()); + if(!root_folder.isEmpty()) + tmp_path = QDir(tmp_path).absoluteFilePath(root_folder); + move_storage(tmp_path); + } + } } #if LIBTORRENT_VERSION_MINOR > 14