Pluginmanager: Test before adding plugin to tests list.

This commit is contained in:
Bill King
2011-02-16 17:09:05 +01:00
parent 8ef42cce44
commit f007410405

View File

@@ -109,7 +109,7 @@ bool OptionsParser::checkForTestOption()
if (nextToken(RequiredToken)) { if (nextToken(RequiredToken)) {
if(m_currentArg == "all") { if(m_currentArg == "all") {
foreach(PluginSpec *spec, m_pmPrivate->pluginSpecs) { foreach(PluginSpec *spec, m_pmPrivate->pluginSpecs) {
if (spec) if (spec && !m_pmPrivate->testSpecs.contains(spec))
m_pmPrivate->testSpecs.append(spec); m_pmPrivate->testSpecs.append(spec);
} }
} else { } else {
@@ -119,7 +119,7 @@ bool OptionsParser::checkForTestOption()
*m_errorString = QCoreApplication::translate("PluginManager", *m_errorString = QCoreApplication::translate("PluginManager",
"The plugin '%1' does not exist.").arg(m_currentArg); "The plugin '%1' does not exist.").arg(m_currentArg);
m_hasError = true; m_hasError = true;
} else { } else if(!m_pmPrivate->testSpecs.contains(spec)) {
m_pmPrivate->testSpecs.append(spec); m_pmPrivate->testSpecs.append(spec);
} }
} }