Skip to content
Snippets Groups Projects
Commit 0db39c29 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

ProjectTree: Preserve selection when enabling sync


When current open file is selected

Change-Id: I24567008ce22e4ebd9810fbbf498a90b7f586ce0
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent c7ed4556
No related branches found
No related tags found
No related merge requests found
...@@ -308,9 +308,11 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project) ...@@ -308,9 +308,11 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project)
const QModelIndex mainIndex = m_model->indexForNode(node); const QModelIndex mainIndex = m_model->indexForNode(node);
if (mainIndex.isValid() && mainIndex != m_view->selectionModel()->currentIndex()) { if (mainIndex.isValid()) {
m_view->setCurrentIndex(mainIndex); if (mainIndex != m_view->selectionModel()->currentIndex()) {
m_view->scrollTo(mainIndex); m_view->setCurrentIndex(mainIndex);
m_view->scrollTo(mainIndex);
}
} else { } else {
if (debug) if (debug)
qDebug() << "clear selection"; qDebug() << "clear selection";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment