diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 392a75b43be..bfea5520a88 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2569,7 +2569,7 @@ void ProjectExplorerPlugin::renameFile() ProjectTreeWidget *treeWidget = qobject_cast(focusWidget); if (treeWidget) { treeWidget->editCurrentItem(); - break; + return; } focusWidget = focusWidget->parentWidget(); } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 37c0e1446e7..2e326022cc6 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -273,8 +273,8 @@ void ProjectTreeWidget::setAutoSynchronization(bool sync, bool syncNow) void ProjectTreeWidget::editCurrentItem() { - if (!m_view->selectionModel()->selectedIndexes().isEmpty()) - m_view->edit(m_view->selectionModel()->selectedIndexes().first()); + if (m_view->selectionModel()->currentIndex().isValid()) + m_view->edit(m_view->selectionModel()->currentIndex()); } void ProjectTreeWidget::setCurrentItem(Node *node, Project *project)