1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Enumerate: Replace some non-ranged loops

This commit is contained in:
reuk 2023-09-21 14:34:52 +01:00
parent cb44d72b78
commit 94ee60041f
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
9 changed files with 45 additions and 54 deletions

View file

@ -519,13 +519,14 @@ public:
auto& enabledModules = project.getEnabledModules();
PopupMenu allModules;
int index = 100;
// JUCE path
PopupMenu jucePathModules;
for (auto& mod : ProjucerApplication::getApp().getJUCEPathModulesList().getAllModules())
jucePathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
for (const auto [index, mod] : enumerate (ProjucerApplication::getApp().getJUCEPathModulesList().getAllModules(),
100))
{
jucePathModules.addItem (index, mod.first, ! enabledModules.isModuleEnabled (mod.first));
}
jucePathModules.addSeparator();
jucePathModules.addItem (-1, "Re-scan path");
@ -533,11 +534,13 @@ public:
allModules.addSubMenu ("Global JUCE modules path", jucePathModules);
// User path
index = 200;
PopupMenu userPathModules;
for (auto& mod : ProjucerApplication::getApp().getUserPathsModulesList().getAllModules())
userPathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
for (const auto [index, mod] : enumerate (ProjucerApplication::getApp().getUserPathsModulesList().getAllModules(),
200))
{
userPathModules.addItem (index, mod.first, ! enabledModules.isModuleEnabled (mod.first));
}
userPathModules.addSeparator();
userPathModules.addItem (-2, "Re-scan path");
@ -545,11 +548,13 @@ public:
allModules.addSubMenu ("Global user modules path", userPathModules);
// Exporter path
index = 300;
PopupMenu exporterPathModules;
for (auto& mod : project.getExporterPathsModulesList().getAllModules())
exporterPathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
for (const auto [index, mod] : enumerate (project.getExporterPathsModulesList().getAllModules(),
300))
{
exporterPathModules.addItem (index, mod.first, ! enabledModules.isModuleEnabled (mod.first));
}
exporterPathModules.addSeparator();
exporterPathModules.addItem (-3, "Re-scan path");

View file

@ -72,11 +72,10 @@ public:
{
jassert (columnHeaders.size() == columnWidths.size());
auto index = 0;
for (auto s : columnHeaders)
for (const auto [index, s] : enumerate (columnHeaders))
{
addAndMakeVisible (headers.add (new Label (s, s)));
widths.add (columnWidths.getUnchecked (index++));
widths.add (columnWidths.getUnchecked ((int) index));
}
recalculateWidths();