forked from qt-creator/qt-creator
Core: Turn soft assert into if clause
It is perfectly legal to have a plugin disabled that was enabled before. If the respective plugin has an output pane the respective setting had been stored and the pane can not be restored when the plugin is not loaded. Change-Id: I25910c44dba83faf3c52ae836f2e83d0e69236d5 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -432,7 +432,8 @@ void OutputPaneManager::readSettings()
|
||||
settings->setArrayIndex(i);
|
||||
Id id = Id::fromSetting(settings->value(QLatin1String(outputPaneIdKeyC)));
|
||||
const int idx = Utils::indexOf(g_outputPanes, Utils::equal(&OutputPaneData::id, id));
|
||||
QTC_ASSERT(idx >= 0, continue);
|
||||
if (idx < 0) // happens for e.g. disabled plugins (with outputpanes) that were loaded before
|
||||
continue;
|
||||
const bool visible = settings->value(QLatin1String(outputPaneVisibleKeyC)).toBool();
|
||||
g_outputPanes[idx].buttonVisible = visible;
|
||||
g_outputPanes[idx].button->setVisible(visible);
|
||||
|
Reference in New Issue
Block a user