Bug on DirectoryContentsList setDirectory ? [ RESOLVED ]

Edit: found the problem, user error, not Juce. :oops:

Juce, when using setDirectory in a DirectoryContentsList object in real-time, it doesn´t update the root item name. Is this a bug? Or I must do this in another way? (which I haven´t figured out yet)

Latest Juce files. (July 23 2013)

[code]DirectoryContentsList* directoryList;

directoryList = new DirectoryContentsList (0, thread);
directoryList->setDirectory (folder, true, true);
thread.startThread (3);[/code]

while (directoryList->isStillLoading()) { ; } directoryList->setDirectory(File("C:\\temp"), true, true);

Thanks.

Maybe call refresh()?

Thanks, but that didn´t work. Doing on the DirectoryContentsList doesn´t change the root name, and doing on the TreeView just crashes.

Maybe a quick solution would be able to just rename Root?

Thanks again. :oops:

You’re not explaining your problem very well… Calling DirectoryContentsList::setDirectory() will definitely set its root folder - i.e. a subsequent call to DirectoryContentsList::getDirectory() will return the new folder. Presumably you’re actually talking about some other class that’s not picking up this change? And how are TreeViews involved?

Oops, you are right, its the FileTreeComponent.

FileTreeComponent* treeView;
addAndMakeVisible (treeView = new FileTreeComponent(*directoryList));

Nothing else. So I wonder if the FileTreeComponent is missing something?

Now, more info, if I do:

directoryList->setDirectory(File(audioProcessor->dataFiles->dataFilesString + MODULES_FOLDER), true, true);
treeView->refresh();

I see that the root item name changes BUT crashes right after that.

HOLD! I found the problem, and it was MY mistake. Terrible sorry about this… :oops: