1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 04:54:18 +00:00

- In File tree (torrent content), set parent priority to NORMAL if its children have mixed priorities

* This also fixes the "you must select at least one file" warning when ignoring all files and then selecting only one
This commit is contained in:
Christophe Dumez 2009-12-06 10:19:29 +00:00
parent facd02a7ec
commit 76c4466fb6

View File

@ -184,7 +184,7 @@ public:
return itemData.value(3).toInt();
}
void setPriority(int new_prio) {
void setPriority(int new_prio, bool update_children=true) {
int old_prio = getPriority();
if(old_prio != new_prio) {
itemData.replace(3, new_prio);
@ -200,8 +200,10 @@ public:
}
}
// Update children
foreach(TreeItem* child, childItems) {
child->setPriority(new_prio);
if(update_children) {
foreach(TreeItem* child, childItems) {
child->setPriority(new_prio);
}
}
}
@ -215,7 +217,10 @@ public:
priority = child->getPriority();
first = false;
} else {
if(child->getPriority() != priority) return;
if(child->getPriority() != priority) {
setPriority(NORMAL, false);
return;
}
}
}
setPriority(priority);