fix typo; assert load sizes

This commit is contained in:
Joseph Lenox 2018-11-18 16:43:55 -06:00 committed by Joseph Lenox
parent 9306c25db2
commit c8662bad0a

View File

@ -72,8 +72,9 @@ void PresetChooser::load(std::array<Presets, preset_types> presets) {
size_t i {0}; size_t i {0};
std::vector<std::string> preset_names {}; std::vector<std::string> preset_names {};
// populate the chooser // populate the chooser
for (auto* chooser : this->preset_choosers[get_preset(group)]) { for (auto* chooser : this->preset_choosers[get_preset(group)]) {
chooser->Clear(); chooser->Clear();
assert(chooser->GetCount() == 0);
for (auto preset : current_list) { for (auto preset : current_list) {
wxBitmap bitmap; wxBitmap bitmap;
switch (group) { switch (group) {
@ -96,6 +97,8 @@ void PresetChooser::load(std::array<Presets, preset_types> presets) {
chooser->Append(preset.name, bitmap); chooser->Append(preset.name, bitmap);
__chooser_names[get_preset(group)].push_back(preset.name); __chooser_names[get_preset(group)].push_back(preset.name);
} }
assert(chooser->GetCount() == current_list.size());
// Apply default options from settings // Apply default options from settings
bool updated_from_settings = false; bool updated_from_settings = false;
if (settings_defaults.size() > i) { // only apply if there is a value from Settings if (settings_defaults.size() > i) { // only apply if there is a value from Settings