1
0
Fork 0
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:
ed 2018-08-17 15:14:53 +01:00
parent a41de9522b
commit 15e09fdc5e

View file

@ -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)
};