mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-21 01:24:21 +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>");
|
choices.add ("<None>");
|
||||||
ids.add (var());
|
ids.add (var());
|
||||||
|
|
||||||
for (int i = 0; i < images.size(); ++i)
|
for (const auto* imageItem : images)
|
||||||
{
|
{
|
||||||
choices.add (images.getUnchecked(i)->getName());
|
choices.add (imageItem->getName());
|
||||||
ids.add (images.getUnchecked(i)->getID());
|
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),
|
props.add (new ChoicePropertyComponent (smallIconValue, "Icon (Small)", choices, ids),
|
||||||
"Sets an icon to use for the executable.");
|
"Sets an icon to use for the executable.");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue