Introjucer: Recursive ValueTree Sorting


#1

Hi Jules,

Would like to request an upgrade to the sorting of file/group items - recursive sorting:

jucer_Project.cpp:

static void sortRecursively (ValueTree tree,
                             bool keepGroupsAtStart,
                             juce::UndoManager* undoManager)
{
    if (keepGroupsAtStart)
    {
        ItemSorterWithGroupsAtStart sorter;
        tree.sort (sorter, undoManager, true);
    }
    else
    {
        ItemSorter sorter;
        tree.sort (sorter, undoManager, true);
    }

    for (int i = tree.getNumChildren(); --i >= 0;)
        sortRecursively (tree.getChild (i), keepGroupsAtStart, undoManager);
}

void Project::Item::sortAlphabetically (bool keepGroupsAtStart)
{
    sortRecursively (state, keepGroupsAtStart, getUndoManager());
}

#2

I’d rather not do that, it’d be annoying if you only wanted to sort the outer level. What kind of mega-trees are you working with where a feature like this would actually be of any significant use?


#3

I find the inverse personally, regardless of the amount of levels… (Kind of OCD)

My work’s project, comprised of a few hundred of our own files, and other 3rd-party libraries.


#4

What if there was a compromise; having an Introjucer setting with this toggled off by default? (Introjucer stores settings, right?)