From 877083e9d98278adebc8e0e67e030fac7c6aa778 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 8 Nov 2017 08:13:53 -0500 Subject: [PATCH] Attempt to fix module order in manufacturer list --- src/app/RackWidget.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index 2d368c95..bc361141 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -398,32 +398,24 @@ struct AddManufacturerMenuItem : MenuItem { std::string manufacturerName; Vec modulePos; Menu *createChildMenu() override { + Menu *menu = new Menu(); + // Collect models which have this manufacturer name - std::set models; for (Plugin *plugin : gPlugins) { for (Model *model : plugin->models) { if (model->manufacturerName == manufacturerName) { - models.insert(model); + AddModuleMenuItem *item = new AddModuleMenuItem(); + item->text = model->name; + // item->rightText = model->plugin->slug; + // if (!model->plugin->version.empty()) + // item->rightText += " v" + model->plugin->version; + item->model = model; + item->modulePos = modulePos; + menu->pushChild(item); } } } - if (models.empty()) - return NULL; - - // Model items - Menu *menu = new Menu(); - for (Model *model : models) { - AddModuleMenuItem *item = new AddModuleMenuItem(); - item->text = model->name; - // item->rightText = model->plugin->slug; - // if (!model->plugin->version.empty()) - // item->rightText += " v" + model->plugin->version; - item->model = model; - item->modulePos = modulePos; - menu->pushChild(item); - } - // Metadata items /* {