mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added a FileTreeComponent::refresh() method.
This commit is contained in:
parent
7404020717
commit
74a727b42f
2 changed files with 16 additions and 6 deletions
|
|
@ -209,13 +209,8 @@ private:
|
|||
FileTreeComponent::FileTreeComponent (DirectoryContentsList& listToShow)
|
||||
: DirectoryContentsDisplayComponent (listToShow)
|
||||
{
|
||||
FileListTreeItem* const root
|
||||
= new FileListTreeItem (*this, 0, 0, listToShow.getDirectory(),
|
||||
listToShow.getTimeSliceThread());
|
||||
|
||||
root->setSubContentsList (&listToShow, false);
|
||||
setRootItemVisible (false);
|
||||
setRootItem (root);
|
||||
refresh();
|
||||
}
|
||||
|
||||
FileTreeComponent::~FileTreeComponent()
|
||||
|
|
@ -223,6 +218,18 @@ FileTreeComponent::~FileTreeComponent()
|
|||
deleteRootItem();
|
||||
}
|
||||
|
||||
void FileTreeComponent::refresh()
|
||||
{
|
||||
deleteRootItem();
|
||||
|
||||
FileListTreeItem* const root
|
||||
= new FileListTreeItem (*this, nullptr, 0, fileList.getDirectory(),
|
||||
fileList.getTimeSliceThread());
|
||||
|
||||
root->setSubContentsList (&fileList, false);
|
||||
setRootItem (root);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
File FileTreeComponent::getSelectedFile (const int index) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue