Commit 8ed4685b authored by Eike Ziller's avatar Eike Ziller

Settings: Do not crash when jumping to filtered out category

Task-number: QTCREATORBUG-17677
Change-Id: I95633a905d71b981e0bb72ce4af2a2fed605f39d
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent cc97609e
......@@ -480,10 +480,16 @@ void SettingsDialog::showPage(const Id pageId)
return; // Unknown settings page, probably due to missing plugin.
if (initialCategoryIndex != -1) {
const QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
QModelIndex modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
if (!modelIndex.isValid()) { // filtered out, so clear filter first
m_filterLineEdit->setText(QString());
modelIndex = m_proxyModel->mapFromSource(m_model->index(initialCategoryIndex));
}
m_categoryList->setCurrentIndex(modelIndex);
if (initialPageIndex != -1)
categories.at(initialCategoryIndex)->tabWidget->setCurrentIndex(initialPageIndex);
if (initialPageIndex != -1) {
if (QTC_GUARD(categories.at(initialCategoryIndex)->tabWidget))
categories.at(initialCategoryIndex)->tabWidget->setCurrentIndex(initialPageIndex);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment