Fixes: - Crash on searching in "current project"

Task:     - 243147
RevBy:    - Thorbjørn
Details:  - Crash occurred in case there actually is no "current
project", e.g. because the current file doesn't appear in a project.
This commit is contained in:
con
2009-02-10 12:13:45 +01:00
parent be38c9b4f0
commit 19670c5beb

View File

@@ -104,11 +104,18 @@ void FindToolWindow::setCurrentFilter(int index)
QWidget *configWidget = m_configWidgets.at(i);
if (!configWidget)
continue;
if (i == index)
if (i == index) {
m_ui.configWidget->layout()->addWidget(configWidget);
else
bool enabled = m_filters.at(i)->isEnabled();
m_ui.matchCase->setEnabled(enabled);
m_ui.wholeWords->setEnabled(enabled);
m_ui.searchTerm->setEnabled(enabled);
m_ui.searchButton->setEnabled(enabled);
configWidget->setEnabled(enabled);
} else {
configWidget->setParent(0);
}
}
}
void FindToolWindow::search()