forked from qt-creator/qt-creator
PluginManager: Implement -load %plugin% option
This loads a plugin that is disabled by default. Change-Id: Ibbc9849c417519904fe1e69a46f93a7cc1c7edc8 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -609,6 +609,9 @@ static inline void formatOption(QTextStream &str,
|
||||
|
||||
void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int descriptionIndentation)
|
||||
{
|
||||
formatOption(str, QLatin1String(OptionsParser::LOAD_OPTION),
|
||||
QLatin1String("plugin"), QLatin1String("Load <plugin>"),
|
||||
optionIndentation, descriptionIndentation);
|
||||
formatOption(str, QLatin1String(OptionsParser::NO_LOAD_OPTION),
|
||||
QLatin1String("plugin"), QLatin1String("Do not load <plugin>"),
|
||||
optionIndentation, descriptionIndentation);
|
||||
@@ -1120,7 +1123,7 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
|
||||
return;
|
||||
|
||||
// don't load disabled plugins.
|
||||
if ((spec->isDisabledIndirectly() || !spec->isEnabledInSettings()) && destState == PluginSpec::Loaded)
|
||||
if (!spec->isEffectivelyEnabled() && destState == PluginSpec::Loaded)
|
||||
return;
|
||||
|
||||
switch (destState) {
|
||||
@@ -1249,6 +1252,11 @@ void PluginManagerPrivate::resolveDependencies()
|
||||
foreach (PluginSpec *spec, pluginSpecs) {
|
||||
spec->d->resolveDependencies(pluginSpecs);
|
||||
}
|
||||
|
||||
// Reset disabledIndirectly flag
|
||||
foreach (PluginSpec *spec, loadQueue())
|
||||
spec->d->disabledIndirectly = false;
|
||||
|
||||
foreach (PluginSpec *spec, loadQueue()) {
|
||||
spec->d->disableIndirectlyIfDependencyDisabled();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user