Skip to content
Snippets Groups Projects
Commit 1815c9ea authored by Lyndon Brown's avatar Lyndon Brown Committed by Hugo Beauzée-Luyssen
Browse files

macos: use preferred order for adv prefs tree cat nodes

this is the macos version of the previous qt commit.
parent 5a91a25e
No related branches found
No related tags found
No related merge requests found
......@@ -560,6 +560,24 @@ enum VLCTreeBranchType {
}
}
module_list_free(modules);
// Sort the top-level cat items into preferred order
NSUInteger index = 0;
NSUInteger childrenCount = [[self children] count];
for (unsigned i = 0; i < ARRAY_SIZE(categories_array); i++) {
// Try to find index of current cat
for (NSUInteger j = index; j < childrenCount; j++) {
VLCTreeBranchItem * item = [[self children] objectAtIndex:j];
if ([item category] == categories_array[i].id) {
if (j != index) {
[[self children] exchangeObjectAtIndex:j withObjectAtIndex:index];
}
++index;
break;
}
}
}
return _children;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment