ProjectTree: Preserve selection when enabling sync

When current open file is selected

Change-Id: I24567008ce22e4ebd9810fbbf498a90b7f586ce0
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Orgad Shaneh
2013-02-06 23:05:34 +02:00
committed by Orgad Shaneh
parent c7ed4556d8
commit 0db39c29f0

View File

@@ -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()) {
if (mainIndex.isValid()) {
if (mainIndex != m_view->selectionModel()->currentIndex()) {
m_view->setCurrentIndex(mainIndex);
m_view->scrollTo(mainIndex);
}
} else {
if (debug)
qDebug() << "clear selection";