forked from qt-creator/qt-creator
PluginManager: Add "-load all" and "-noload all" command line options
Task-number: QTCREATORBUG-11826 Change-Id: Ia033c1f8c69bbb2c757a0d8284c56168ad88155c Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -147,16 +147,22 @@ bool OptionsParser::checkForLoadOption()
|
||||
if (m_currentArg != QLatin1String(LOAD_OPTION))
|
||||
return false;
|
||||
if (nextToken(RequiredToken)) {
|
||||
PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
|
||||
if (!spec) {
|
||||
if (m_errorString)
|
||||
*m_errorString = QCoreApplication::translate("PluginManager",
|
||||
"The plugin \"%1\" does not exist.")
|
||||
.arg(m_currentArg);
|
||||
m_hasError = true;
|
||||
} else {
|
||||
spec->d->setForceEnabled(true);
|
||||
if (m_currentArg == QLatin1String("all")) {
|
||||
foreach (PluginSpec *spec, m_pmPrivate->pluginSpecs)
|
||||
spec->d->setForceEnabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
} else {
|
||||
PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
|
||||
if (!spec) {
|
||||
if (m_errorString)
|
||||
*m_errorString = QCoreApplication::translate("PluginManager",
|
||||
"The plugin \"%1\" does not exist.")
|
||||
.arg(m_currentArg);
|
||||
m_hasError = true;
|
||||
} else {
|
||||
spec->d->setForceEnabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -167,18 +173,24 @@ bool OptionsParser::checkForNoLoadOption()
|
||||
if (m_currentArg != QLatin1String(NO_LOAD_OPTION))
|
||||
return false;
|
||||
if (nextToken(RequiredToken)) {
|
||||
PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
|
||||
if (!spec) {
|
||||
if (m_errorString)
|
||||
*m_errorString = QCoreApplication::translate("PluginManager",
|
||||
"The plugin \"%1\" does not exist.").arg(m_currentArg);
|
||||
m_hasError = true;
|
||||
} else {
|
||||
spec->d->setForceDisabled(true);
|
||||
// recursively disable all plugins that require this plugin
|
||||
foreach (PluginSpec *dependantSpec, PluginManager::pluginsRequiringPlugin(spec))
|
||||
dependantSpec->d->setForceDisabled(true);
|
||||
if (m_currentArg == QLatin1String("all")) {
|
||||
foreach (PluginSpec *spec, m_pmPrivate->pluginSpecs)
|
||||
spec->d->setForceDisabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
} else {
|
||||
PluginSpec *spec = m_pmPrivate->pluginByName(m_currentArg);
|
||||
if (!spec) {
|
||||
if (m_errorString)
|
||||
*m_errorString = QCoreApplication::translate("PluginManager",
|
||||
"The plugin \"%1\" does not exist.").arg(m_currentArg);
|
||||
m_hasError = true;
|
||||
} else {
|
||||
spec->d->setForceDisabled(true);
|
||||
// recursively disable all plugins that require this plugin
|
||||
foreach (PluginSpec *dependantSpec, PluginManager::pluginsRequiringPlugin(spec))
|
||||
dependantSpec->d->setForceDisabled(true);
|
||||
m_isDependencyRefreshNeeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user