summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmljsoutline.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2010-08-25 13:21:38 +0200
committerKai Koehne <kai.koehne@nokia.com>2010-08-25 13:28:04 +0200
commit6cf563bb25b3bc8f48cd45e22d648bfdb16bca99 (patch)
treee275f20a5bed22b91159c7de8543e1ab610a588a /src/plugins/qmljseditor/qmljsoutline.cpp
parent22fe4f584d26ac3f877722e3fc5457dc0f0b9b89 (diff)
downloadqt-creator-6cf563bb25b3bc8f48cd45e22d648bfdb16bca99.tar.gz
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 ...
Diffstat (limited to 'src/plugins/qmljseditor/qmljsoutline.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljsoutline.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp
index ae2438942a..db9da7dfd6 100644
--- a/src/plugins/qmljseditor/qmljsoutline.cpp
+++ b/src/plugins/qmljseditor/qmljsoutline.cpp
@@ -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();