Browse Source

Re-added duplicate name handling - this got lost in previous update

master
waxfrenzy 22 years ago
parent
commit
2023e0f89f
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C

+ 16
- 0
SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C View File

@@ -378,6 +378,22 @@ LADSPAInfo::DescendGroup(string prefix,
} }
plugins.sort(); plugins.sort();


// Deal with duplicates by numbering them
for (list<PluginEntry>::iterator i = plugins.begin();
i != plugins.end(); ) {
string name = i->Name;

i++;
unsigned long n = 2;
while ((i != plugins.end()) && (i->Name == name)) {
stringstream s;
s << n;
i->Name = name + " (" + s.str() + ")";
n++;
i++;
}
}

// Add all ordered entries to the Menu List // Add all ordered entries to the Menu List
// This ensures that plugins appear after groups // This ensures that plugins appear after groups
for (list<PluginEntry>::iterator p = plugins.begin(); p != plugins.end(); p++) { for (list<PluginEntry>::iterator p = plugins.begin(); p != plugins.end(); p++) {


Loading…
Cancel
Save