mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Refresh the modules tree on a timer so that rapid changes to the module search paths don't cause a slow down
This commit is contained in:
parent
a41de9522b
commit
15e09fdc5e
1 changed files with 11 additions and 2 deletions
|
|
@ -476,7 +476,8 @@ private:
|
|||
|
||||
//==============================================================================
|
||||
class EnabledModulesItem : public ProjectTreeItemBase,
|
||||
private Value::Listener
|
||||
private Value::Listener,
|
||||
private Timer
|
||||
{
|
||||
public:
|
||||
EnabledModulesItem (Project& p)
|
||||
|
|
@ -667,9 +668,17 @@ private:
|
|||
if (auto* moduleItem = dynamic_cast<ModuleItem*> (getSubItem (i)))
|
||||
moduleItem->refreshModuleInfoIfCurrentlyShowing (juceModulePathChanged);
|
||||
|
||||
refreshSubItems();
|
||||
// coalesce changes using a timer in case the value is changing rapidly
|
||||
startTimer (750);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void timerCallback() override
|
||||
{
|
||||
stopTimer();
|
||||
refreshSubItems();
|
||||
}
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EnabledModulesItem)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue