Browse Source

- 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
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
76c4466fb6
  1. 13
      src/torrentfilesmodel.h

13
src/torrentfilesmodel.h

@ -184,7 +184,7 @@ public: @@ -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: @@ -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: @@ -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);

Loading…
Cancel
Save