forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
c7ed4556d8
commit
0db39c29f0
@@ -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()) {
|
||||||
|
if (mainIndex != m_view->selectionModel()->currentIndex()) {
|
||||||
m_view->setCurrentIndex(mainIndex);
|
m_view->setCurrentIndex(mainIndex);
|
||||||
m_view->scrollTo(mainIndex);
|
m_view->scrollTo(mainIndex);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "clear selection";
|
qDebug() << "clear selection";
|
||||||
|
|||||||
Reference in New Issue
Block a user