projectexplorer: improved rename functionality

This commit is contained in:
itsmattkc
2021-09-21 11:57:26 -07:00
parent 75b4e3e257
commit f184e5cd31
+12 -7
View File
@@ -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 {