# HG changeset patch # User Chris Cannam # Date 1199898584 0 # Node ID 1000222cd8f1b55358c73652ad7e9b740b84ad12 # Parent 66dc075256710cf5209c561931bd66062bdcfffc * better handling of cases with more than one copy of the same plugin in different libraries -- a bit mad, but it happened to me diff -r 66dc07525671 -r 1000222cd8f1 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Dec 13 17:14:33 2007 +0000 +++ b/main/MainWindow.cpp Wed Jan 09 17:09:44 2008 +0000 @@ -1327,6 +1327,20 @@ } } + // Names should only be duplicated here if they have the same + // plugin name, output name and maker but are in different library + // .so names -- that won't happen often I hope + std::map idNameSonameMap; + std::set seenNames, duplicateNames; + for (unsigned int i = 0; i < transforms.size(); ++i) { + QString name = transforms[i].name; + if (seenNames.find(name) != seenNames.end()) { + duplicateNames.insert(name); + } else { + seenNames.insert(name); + } + } + for (unsigned int i = 0; i < transforms.size(); ++i) { QString name = transforms[i].name; @@ -1346,6 +1360,16 @@ QString pluginName = name.section(": ", 0, 0); QString output = name.section(": ", 1); + if (duplicateNames.find(pluginName) != duplicateNames.end()) { + pluginName = QString("%1 <%2>") + .arg(pluginName) + .arg(transforms[i].identifier.section(':', 1, 1)); + if (output == "") name = pluginName; + else name = QString("%1: %2") + .arg(pluginName) + .arg(output); + } + QAction *action = new QAction(tr("%1...").arg(name), this); connect(action, SIGNAL(triggered()), this, SLOT(addLayer())); m_transformActions[action] = transforms[i].identifier;