This was noticed by kbroulik. after commit/6ca0b93e6029dc53a09e9e498e509ba714c2a1d7 ( Use KIO::rename instead of KIO::moveAs in setData ) renaming a file will work but when trying to launch it it gives an error about oldUrl cannot be found. Restarting palsmashell seems to fix that. Simple reproducer: Add dolphin to desktop Rename it to dolphin2 Click on the renamed icon You should get an error Restart plasmashell and all is fine again
Only affects desktop:/ KIO slave in FolderView. When FV is set to e.g. /home/foo it works.
Might be a bug in the desktop KIO that sets UDS_TARGET_URL to LOCAL_PATH for some reason.
In KCoreDirListerCache::slotFileRenamed it updates KFileItem's localPath if "dstPath" is provided (which it is by emitFileRenamedWithLocalPath) but it cannot know that desktop KIO sets the target URL to it, so it gets out of sync.
Confirmed; thanks for the debugging. The thing is, shortly after KCoreDirLister::slotFileRenamed is called, desktopnotifier also triggers a full re-listing via KDirNotify::FilesAdded which calls KCoreDirLister::updateDirectory. That's when the dirlister should notice that the target URL of the item has changed. But it failed to do so because KFileItem::cmp() ignores UDS_LOCAL_PATH and UDS_TARGET_URL. Adding that fixes the bug. I'll work on a unittest and then commit that.
Git commit 1449ecf136b5d170cb7c66e62a302bb9e9df164b by David Faure. Committed on 22/07/2017 at 06:52. Pushed by dfaure into branch 'master'. Ensure KDirLister updates items whose target URL has changed. This fixes the bug where renaming a desktop icon would not update its target URL, so clicking on it would try to open the old file. The tricky bit in all this is that first KCoreDirLister::slotFileRenamed is called, which updates the item's name (and local path), but then later on desktopnotifier also triggers a full re-listing via KDirNotify::FilesAdded which calls KCoreDirLister::updateDirectory. That's when the dirlister should notice that the target URL of the item has changed. For consistency, also compare local paths, although this commit doesn't actually require it. Unittest improved in plasma-workspace/kioslave/desktop/tests. FIXED-IN: 5.37 M +2 -0 src/core/kfileitem.cpp https://commits.kde.org/kio/1449ecf136b5d170cb7c66e62a302bb9e9df164b
*** Bug 382730 has been marked as a duplicate of this bug. ***
Git commit 31bbfe5987698d39e806087e559e74b5fab70ed6 by David Faure. Committed on 28/07/2017 at 10:01. Pushed by dfaure into branch 'Plasma/5.10'. Improve unittest for renaming desktop icons to ensure that the target URL is updated by KDirLister. This unittest requires the KIO fix 1449ecf136 (KF 5.37). The unittest detected a "//" in the UDS_LOCAL_PATH values, so this commit fixed that as well. M +9 -1 kioslave/desktop/kio_desktop.cpp M +1 -1 kioslave/desktop/tests/CMakeLists.txt M +36 -19 kioslave/desktop/tests/kio_desktop_test.cpp https://commits.kde.org/plasma-workspace/31bbfe5987698d39e806087e559e74b5fab70ed6
*** Bug 383996 has been marked as a duplicate of this bug. ***
The test continues failing. Should it be dropped?