in findItemFromIdentifierString, 2.0.21 version of modules code, Backslashes are not treated correctly.
The original juce method:
[code]
TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
{
const String thisId (getUniqueName());
if (thisId == identifierString)
return this;
if (identifierString.startsWith (thisId + "/"))
{
const String remainingPath (identifierString.substring (thisId.length() + 1));
const bool wasOpen = isOpen();
setOpen (true);
for (int i = subItems.size(); --i >= 0;)
{
TreeViewItem* item = subItems.getUnchecked(i)->findItemFromIdentifierString (remainingPath);
if (item != nullptr)
return item;
}
setOpen (wasOpen);
}
return nullptr;
}[/code]
The above doesn´t work unless you change two lines, as per the version below:
[code]TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString)
{
const String thisId (getUniqueName());
// Onar3d was here
if ("/" + thisId == identifierString)
return this;
// and here
if (identifierString.startsWith ("/" + thisId))
{
const String remainingPath (identifierString.substring (thisId.length() + 1));
const bool wasOpen = isOpen();
setOpen (true);
for (int i = subItems.size(); --i >= 0;)
{
TreeViewItem* item = subItems.getUnchecked(i)->findItemFromIdentifierString (remainingPath);
if (item != nullptr)
return item;
}
setOpen (wasOpen);
}
return nullptr;
}[/code]
The string I call the function with is straight from getItemIdentifierString(), not edited by myself in any way.