QmlOutline: Cut down update times considerably

Cut down update times of Outline by a magnitude by only emitting
itemChanged signal if absolutely needed. This doesn't include the change
of the icon, because QIcon is missing a comparison operator ...
This commit is contained in:
Kai Koehne
2010-08-25 13:21:38 +02:00
parent 22fe4f584d
commit 6cf563bb25
4 changed files with 148 additions and 171 deletions

View File

@@ -158,7 +158,12 @@ void QmlJSOutlineWidget::updateSelectionInText(const QItemSelection &selection)
if (!selection.indexes().isEmpty()) {
QModelIndex index = selection.indexes().first();
AST::SourceLocation location = index.data(QmlOutlineModel::SourceLocationRole).value<AST::SourceLocation>();
QModelIndex sourceIndex = m_filterModel->mapToSource(index);
AST::SourceLocation location = m_editor->outlineModel()->sourceLocation(sourceIndex);
if (!location.isValid())
return;
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->cutForwardNavigationHistory();