Bug 477296 - Dolphin moves user to grandparent of deleted directory instead of parent
Summary: Dolphin moves user to grandparent of deleted directory instead of parent
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: bars: location (show other bugs)
Version: 24.01.75
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-11-20 19:20 UTC by Chris Warren
Modified: 2024-02-08 22:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Warren 2023-11-20 19:20:16 UTC
SUMMARY

If a Dolphin window is in a directory that is deleted, Dolphin moves the user to the grandparent directory of that deleted directory rather than the parent.


STEPS TO REPRODUCE
1. In Dolphin, go to directory X
2. In another process (such as konsole), delete directory X
3. Observe how Dolphin moves the user when Dolphin notices the directory is deleted

OBSERVED RESULT

When a Dolphin window is in a directory that is deleted, Dolphin automatically moves the user to the grandparent of the deleted directory instead of the parent

For example, I created a directory called testdir in $HOME
Under testdir, I created directory test1
Under test1, I created directory test2

If I navigate to test2 in Dolphin then delete test2 in another process, Dolphin reports: 
Current location changed, '$HOME/testdir/dir1' is no longer accessible.

Then I am moved to $HOME/testdir. Yet I see dir1 in $HOME/testdir and I can access $HOME/testdir/test1.

Similarly, if I deleted $HOME/testdir/test1 ($HOME/testdir still exists), Dolphin would redirect me to $HOME instead of $HOME/testdir.

EXPECTED RESULT

Dolphin should drop me in the location nearest to the directory that was deleted.

In the above example where $HOME/testdir/test1/test2 was deleted, it should drop me in $HOME/testdir/test1 instead of testdir since $HOME/testdir/test1 still exists.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Observed in both KDE Neon Unstable and ArchLinux (both from repos and built from kdesrc-build)
(available in About System)
KDE Plasma Version:  5.81.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Comment 1 fanzhuyifan 2023-11-20 22:57:56 UTC
Can reproduce
Comment 2 Christoph Dreier 2024-02-08 22:12:24 UTC
Can someone explain the mechanism that informs Dolphin about the deletion of that directory?
I am on Arch and nothing happens if I delete the currently shown directory from outside of Dolphin. Am I missing some component of Plasma/Frameworks/whatever or could it be a configuration problem?

Installed versions:
- Dolphin 23.08.4
- KDE Frameworks 5.113.0
- Qt 5.15.12 (built against 5.15.11)

Only If I refresh the view it detects that the dir was deleted and displays "The file or folder /path/to/deleted/dir does not exist" and "Loading canceled", but it does not change the location at all.

It's not a matter of the filesystem in use as this behavior is the same in different mount points with different file systems.
Comment 3 Christoph Dreier 2024-02-08 22:31:10 UTC
Disregard my last comment. Completely missed the (for my beginner eyes) subtle Plasma 6 references and messed up the other version numbers. Sorry for that!

Just tested it on
Plasma 5.93.0
Frameworks Version 5.249.0
Qt Version 6.7.0
and can confirm: Dolphin drops me into the grandparent dir. No matter which file system.