Browse Source

Projucer: Check project item still exists when initialising exporter icon settings and reset to default if missing

v6.1.6
ed 3 years ago
parent
commit
0b79bcec69
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp

+ 12
- 3
extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp View File

@@ -333,12 +333,21 @@ void ProjectExporter::createIconProperties (PropertyListBuilder& props)
choices.add ("<None>");
ids.add (var());
for (int i = 0; i < images.size(); ++i)
for (const auto* imageItem : images)
{
choices.add (images.getUnchecked(i)->getName());
ids.add (images.getUnchecked(i)->getID());
choices.add (imageItem->getName());
ids.add (imageItem->getID());
}
const auto resetToDefaultIfFileMissing = [&ids] (ValueWithDefault& v)
{
if (! v.isUsingDefault() && ! ids.contains (v.get()))
v.resetToDefault();
};
resetToDefaultIfFileMissing (smallIconValue);
resetToDefaultIfFileMissing (bigIconValue);
props.add (new ChoicePropertyComponent (smallIconValue, "Icon (Small)", choices, ids),
"Sets an icon to use for the executable.");


Loading…
Cancel
Save