projectexplorer: improved rename functionality
This commit is contained in:
@@ -254,14 +254,19 @@ QAbstractItemView *ProjectExplorer::CurrentView() const
|
|||||||
void ProjectExplorer::ItemClickedSlot(const QModelIndex &index)
|
void ProjectExplorer::ItemClickedSlot(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
if (clicked_index_ == index) {
|
if (CurrentView()->selectionModel()->selectedRows().size() == 1) {
|
||||||
// The item has been clicked more than once, start a timer for renaming
|
if (clicked_index_ == index) {
|
||||||
rename_timer_.start();
|
// The item has been clicked more than once, start a timer for renaming
|
||||||
} else {
|
rename_timer_.start();
|
||||||
// Cache this index for the next click
|
} else {
|
||||||
clicked_index_ = index;
|
// 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();
|
rename_timer_.stop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user