BUGFIX: Fix issue when altering files priorities of a seeding torrent (closes #665799)

This commit is contained in:
Christophe Dumez
2010-10-24 08:07:17 +00:00
parent eb1feddea6
commit ad252f432a
2 changed files with 23 additions and 3 deletions

View File

@@ -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 <chris@qbittorrent.org> - v2.4.7
- BUGFIX: Display the priority column when the queueing system gets enabled

View File

@@ -585,6 +585,14 @@ void QTorrentHandle::prioritize_files(const std::vector<int> &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