Browse Source

Sort preset names in module preset menu.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
04a24fb71f
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/app/ModuleWidget.cpp

+ 3
- 1
src/app/ModuleWidget.cpp View File

@@ -848,7 +848,9 @@ static void appendPresetItems(ui::Menu* menu, WeakPtr<ModuleWidget> moduleWidget
bool hasPresets = false;
// Note: This is not cached, so opening this menu each time might have a bit of latency.
if (system::isDirectory(presetDir)) {
for (std::string path : system::getEntries(presetDir)) {
std::vector<std::string> entries = system::getEntries(presetDir);
std::sort(entries.begin(), entries.end());
for (std::string path : entries) {
std::string name = system::getStem(path);
// Remove "1_", "42_", "001_", etc at the beginning of preset filenames
std::regex r("^\\d*_");


Loading…
Cancel
Save