forked from qt-creator/qt-creator
Fixed crash when using -noload to disable multiple plugins
The noload behavior is also changed: it now always shows the plugins in About Plugins... menu, even though -noload was used. When using -noload, the enabled state of the plugin is not saved, so if the command line arg is removed, the plugin will be loaded normally. Reviewed-by: con
This commit is contained in:
@@ -786,7 +786,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
|
||||
circularityCheckQueue.append(spec);
|
||||
// check if we have the dependencies
|
||||
if (spec->state() == PluginSpec::Invalid || spec->state() == PluginSpec::Read) {
|
||||
if (!spec->isDisabledByDependency() && spec->isEnabled()) {
|
||||
if (!spec->isDisabledIndirectly() && spec->isEnabled()) {
|
||||
spec->d->hasError = true;
|
||||
spec->d->errorString += "\n";
|
||||
spec->d->errorString += PluginManager::tr("Cannot load plugin because dependencies are not resolved");
|
||||
@@ -814,7 +814,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
|
||||
*/
|
||||
void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destState)
|
||||
{
|
||||
if (spec->hasError() || spec->isDisabledByDependency())
|
||||
if (spec->hasError() || spec->isDisabledIndirectly())
|
||||
return;
|
||||
|
||||
switch (destState) {
|
||||
@@ -953,19 +953,9 @@ PluginSpec *PluginManagerPrivate::pluginForOption(const QString &option, bool *r
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PluginManagerPrivate::removePluginSpec(PluginSpec *spec)
|
||||
void PluginManagerPrivate::disablePluginIndirectly(PluginSpec *spec)
|
||||
{
|
||||
pluginSpecs.removeAll(spec);
|
||||
|
||||
if (pluginCategories.contains(spec->category()))
|
||||
pluginCategories.value(spec->category())->removePlugin(spec);
|
||||
|
||||
foreach(PluginSpec *dep, spec->dependencySpecs()) {
|
||||
dep->removeDependentPlugin(spec);
|
||||
}
|
||||
|
||||
delete spec;
|
||||
spec = 0;
|
||||
spec->d->disabledIndirectly = true;
|
||||
}
|
||||
|
||||
PluginSpec *PluginManagerPrivate::pluginByName(const QString &name) const
|
||||
|
||||
Reference in New Issue
Block a user