mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Check project item still exists when initialising exporter icon settings and reset to default if missing
This commit is contained in:
parent
d5373eed02
commit
0b79bcec69
1 changed files with 12 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue