mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +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:
parent
facd02a7ec
commit
76c4466fb6
@ -184,7 +184,7 @@ public:
|
|||||||
return itemData.value(3).toInt();
|
return itemData.value(3).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPriority(int new_prio) {
|
void setPriority(int new_prio, bool update_children=true) {
|
||||||
int old_prio = getPriority();
|
int old_prio = getPriority();
|
||||||
if(old_prio != new_prio) {
|
if(old_prio != new_prio) {
|
||||||
itemData.replace(3, new_prio);
|
itemData.replace(3, new_prio);
|
||||||
@ -200,8 +200,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Update children
|
// Update children
|
||||||
foreach(TreeItem* child, childItems) {
|
if(update_children) {
|
||||||
child->setPriority(new_prio);
|
foreach(TreeItem* child, childItems) {
|
||||||
|
child->setPriority(new_prio);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +217,10 @@ public:
|
|||||||
priority = child->getPriority();
|
priority = child->getPriority();
|
||||||
first = false;
|
first = false;
|
||||||
} else {
|
} else {
|
||||||
if(child->getPriority() != priority) return;
|
if(child->getPriority() != priority) {
|
||||||
|
setPriority(NORMAL, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setPriority(priority);
|
setPriority(priority);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user