]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix incorrect file selection after file rename
authorAmol Godbole <amolagodbole@gmail.com>
Tue, 1 Aug 2023 09:59:57 +0000 (09:59 +0000)
committerFelix Ernst <felixernst@kde.org>
Tue, 1 Aug 2023 09:59:57 +0000 (09:59 +0000)
forceUrlsSelection() needs to be called only when new name of renamed
file does not exist.

BUG: 417930

src/views/dolphinview.cpp

index 9666ca2ab38b1c6478da786dc04c63c1ff5be6fc..fba7e64199322a33c503df4883e1ce3394ba93a6 100644 (file)
@@ -2063,9 +2063,9 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray &role, con
             KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
             job->uiDelegate()->setAutoErrorHandlingEnabled(true);
 
-            forceUrlsSelection(newUrl, {newUrl});
-
             if (!newNameExistsAlready) {
+                forceUrlsSelection(newUrl, {newUrl});
+
                 // Only connect the result signal if there is no item with the new name
                 // in the model yet, see bug 328262.
                 connect(job, &KJob::result, this, &DolphinView::slotRenamingResult);