From f184e5cd31ca6e10f1d2ef9e9cdbd07cf9557053 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:57:26 -0700 Subject: [PATCH] projectexplorer: improved rename functionality --- .../projectexplorer/projectexplorer.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/widget/projectexplorer/projectexplorer.cpp b/app/widget/projectexplorer/projectexplorer.cpp index fdd74e977..9326cd357 100644 --- a/app/widget/projectexplorer/projectexplorer.cpp +++ b/app/widget/projectexplorer/projectexplorer.cpp @@ -254,14 +254,19 @@ QAbstractItemView *ProjectExplorer::CurrentView() const void ProjectExplorer::ItemClickedSlot(const QModelIndex &index) { if (index.isValid()) { - if (clicked_index_ == index) { - // The item has been clicked more than once, start a timer for renaming - rename_timer_.start(); - } else { - // Cache this index for the next click - clicked_index_ = index; + if (CurrentView()->selectionModel()->selectedRows().size() == 1) { + if (clicked_index_ == index) { + // The item has been clicked more than once, start a timer for renaming + rename_timer_.start(); + } else { + // Cache this index for the next click + clicked_index_ = index; - // If the rename timer had started, stop it now + // If the rename timer had started, stop it now + rename_timer_.stop(); + } + } else { + clicked_index_ = QModelIndex(); rename_timer_.stop(); } } else {