- Increase/decrease priority buttons should now work for finishedTab too

This commit is contained in:
Christophe Dumez 2008-07-14 22:05:13 +00:00
parent 20ae3d997c
commit 27a71ba123

View file

@ -1239,8 +1239,6 @@ void GUI::on_actionIncreasePriority_triggered() {
if(tabs->currentIndex() > 1) return; if(tabs->currentIndex() > 1) return;
if(tabs->currentIndex() == 1) if(tabs->currentIndex() == 1)
inDownloadList = false; inDownloadList = false;
if(!inDownloadList)
return;
QStringList hashes; QStringList hashes;
if(inDownloadList) { if(inDownloadList) {
hashes = downloadingTorrentTab->getSelectedTorrents(); hashes = downloadingTorrentTab->getSelectedTorrents();
@ -1248,8 +1246,13 @@ void GUI::on_actionIncreasePriority_triggered() {
hashes = finishedTorrentTab->getSelectedTorrents(); hashes = finishedTorrentTab->getSelectedTorrents();
} }
foreach(QString hash, hashes) { foreach(QString hash, hashes) {
BTSession->increaseDlTorrentPriority(hash); if(inDownloadList) {
downloadingTorrentTab->updateDlList(); BTSession->increaseDlTorrentPriority(hash);
downloadingTorrentTab->updateDlList();
} else {
BTSession->increaseUpTorrentPriority(hash);
finishedTorrentTab->updateFinishedList();
}
} }
} }
@ -1258,8 +1261,6 @@ void GUI::on_actionDecreasePriority_triggered() {
if(tabs->currentIndex() > 1) return; if(tabs->currentIndex() > 1) return;
if(tabs->currentIndex() == 1) if(tabs->currentIndex() == 1)
inDownloadList = false; inDownloadList = false;
if(!inDownloadList)
return;
QStringList hashes; QStringList hashes;
if(inDownloadList) { if(inDownloadList) {
hashes = downloadingTorrentTab->getSelectedTorrents(); hashes = downloadingTorrentTab->getSelectedTorrents();
@ -1268,8 +1269,13 @@ void GUI::on_actionDecreasePriority_triggered() {
} }
QString hash; QString hash;
foreach(QString hash, hashes) { foreach(QString hash, hashes) {
BTSession->decreaseDlTorrentPriority(hash); if(inDownloadList) {
downloadingTorrentTab->updateDlList(); BTSession->decreaseDlTorrentPriority(hash);
downloadingTorrentTab->updateDlList();
} else {
BTSession->decreaseUpTorrentPriority(hash);
finishedTorrentTab->updateFinishedList();
}
} }
} }