X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d337ece6df43337eff338758ace5204937a000b7..8239be95e341bca24ac984c422f34710e85b80db:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 97bce5aac..e1cbaee8c 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -522,7 +522,12 @@ void DolphinView::changeSelection(const KFileItemList& selection) void DolphinView::renameSelectedItems() { const KFileItemList items = selectedItems(); - if (items.count() > 1) { + const int itemCount = items.count(); + if (itemCount < 1) { + return; + } + + if (itemCount > 1) { // More than one item has been selected for renaming. Open // a rename dialog and rename all items afterwards. RenameDialog dialog(this, items); @@ -557,8 +562,8 @@ void DolphinView::renameSelectedItems() } } } else if (DolphinSettings::instance().generalSettings()->renameInline()) { - Q_ASSERT(items.count() == 1); - + Q_ASSERT(itemCount == 1); + if (isColumnViewActive()) { m_columnView->editItem(items.first()); } else { @@ -567,8 +572,8 @@ void DolphinView::renameSelectedItems() itemView()->edit(proxyIndex); } } else { - Q_ASSERT(items.count() == 1); - + Q_ASSERT(itemCount == 1); + RenameDialog dialog(this, items); if (dialog.exec() == QDialog::Rejected) { return;