mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Projucer: Removed some unnecessary time-consuming function calls to speed up the painting of the modules panel
This commit is contained in:
parent
03e6684355
commit
df824cf5df
1 changed files with 31 additions and 10 deletions
|
|
@ -24,12 +24,20 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
class ModuleItem : public ConfigTreeItemBase
|
||||
class ModuleItem : public ConfigTreeItemBase,
|
||||
private Value::Listener
|
||||
{
|
||||
public:
|
||||
ModuleItem (Project& p, const String& modID)
|
||||
: project (p), moduleID (modID)
|
||||
{
|
||||
missingDependencies = project.getModules().getExtraDependenciesNeeded (moduleID).size() > 0;
|
||||
cppStandardHigherThanProject = project.getModules().doesModuleHaveHigherCppStandardThanProject (moduleID);
|
||||
|
||||
projectCppStandardValue.referTo (project.getCppStandardValue());
|
||||
projectCppStandardValue.addListener (this);
|
||||
|
||||
info = project.getModules().getModuleInfo (moduleID);
|
||||
}
|
||||
|
||||
bool canBeSelected() const override { return true; }
|
||||
|
|
@ -38,8 +46,8 @@ public:
|
|||
String getDisplayName() const override { return moduleID; }
|
||||
String getRenamingName() const override { return getDisplayName(); }
|
||||
void setName (const String&) override {}
|
||||
bool isMissing() const override { return hasMissingDependencies(); }
|
||||
bool hasWarnings() const override { return hasHigherCppStandardThanProject(); }
|
||||
bool isMissing() const override { return missingDependencies; }
|
||||
bool hasWarnings() const override { return cppStandardHigherThanProject; }
|
||||
|
||||
void showDocument() override
|
||||
{
|
||||
|
|
@ -59,7 +67,6 @@ public:
|
|||
|
||||
if (! isSelected())
|
||||
{
|
||||
auto info = project.getModules().getModuleInfo (moduleID);
|
||||
if (info.isValid() && info.getVendor() == "juce")
|
||||
{
|
||||
if (info.getLicense() == "ISC")
|
||||
|
|
@ -89,14 +96,28 @@ public:
|
|||
String moduleID;
|
||||
|
||||
private:
|
||||
bool hasMissingDependencies() const
|
||||
{
|
||||
return project.getModules().getExtraDependenciesNeeded (moduleID).size() > 0;
|
||||
}
|
||||
ModuleDescription info;
|
||||
bool missingDependencies = false;
|
||||
bool cppStandardHigherThanProject = false;
|
||||
Value projectCppStandardValue;
|
||||
|
||||
bool hasHigherCppStandardThanProject() const
|
||||
//==============================================================================
|
||||
void valueChanged (Value& v) override
|
||||
{
|
||||
return project.getModules().doesModuleHaveHigherCppStandardThanProject (moduleID);
|
||||
if (v == projectCppStandardValue)
|
||||
{
|
||||
auto oldVal = cppStandardHigherThanProject;
|
||||
cppStandardHigherThanProject = project.getModules().doesModuleHaveHigherCppStandardThanProject (moduleID);
|
||||
|
||||
if (oldVal != cppStandardHigherThanProject)
|
||||
{
|
||||
if (auto* parent = dynamic_cast<EnabledModulesItem*> (getParentItem()))
|
||||
{
|
||||
parent->refreshSubItems();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue