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
......@@ -308,9 +308,11 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project)
const QModelIndex mainIndex = m_model->indexForNode(node);
if (mainIndex.isValid() && mainIndex != m_view->selectionModel()->currentIndex()) {
m_view->setCurrentIndex(mainIndex);
m_view->scrollTo(mainIndex);
if (mainIndex.isValid()) {
if (mainIndex != m_view->selectionModel()->currentIndex()) {
m_view->setCurrentIndex(mainIndex);
m_view->scrollTo(mainIndex);
}
} else {
if (debug)
qDebug() << "clear selection";
......
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