Bug 467978 - --select fails when dolphin already displays home directory
Summary: --select fails when dolphin already displays home directory
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 22.08.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-30 16:35 UTC by glyphimor
Modified: 2023-03-30 16:35 UTC (History)
1 user (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 glyphimor 2023-03-30 16:35:25 UTC
SUMMARY

Normally, running "dolphin --select file1"  displays file1's parent directory and selects file1, in a new or existing dolphin window/tab. However, if a dolphin window is already displaying the user's home directory, running "dolphin --select file1" doesn't work: the existing ~ window receives focus, but nothing else happens. Note that adding the --new-window argument bypasses the bug: "dolphin --select file1 --new-window" works.

STEPS TO REPRODUCE

I have command line tests for 6 scenarios; 4 work and 2 fail. All dolphin windows need to be closed before each test. I included a sleep command so each test can be copy-pasted, rather than run line by line.

#setup
mkdir dolphin_test
cd dolphin_test
touch file1
mkdir dir0

#test 0 works: no dolphin windows
dolphin --select file1

#test 1 works: test dir already open in dolphin
dolphin . &
sleep 3s
dolphin --select file1

#test 2 works: other dir already open in dolphin
dolphin dir0 &
sleep 3s
dolphin --select file1

#test 3 fails: ~ already open in dolphin
dolphin ~ &
sleep 3s
dolphin --select file1

#test 4 works: ~ and test dir already open in dolphin
dolphin ~ . &
sleep 3s
dolphin --select file1

#test 5 fails: ~ and other dir already open in dolphin
dolphin ~ dir0 &
sleep 3s
dolphin --select file1

OBSERVED RESULT

(for a failing test) The dolphin window/tab displaying the user's home directory receives focus.

EXPECTED RESULT

Dolphin displays the dolphin_test directory and selects file1.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

Summarizing, if ~ is already open in a dolphin window/tab, "dolphin --select file1" doesn't work, UNLESS file1's parent directory is already open in dolphin.

Also, all tests work correctly if you add the --new-window argument: "dolphin --select file1 --new-window".

The trigger for failure appears to be the user's home directory, even if a different directory is set as the dolphin default (in Settings -> Configure Dolphin... -> Startup -> Show on startup).

--select used to work normally for me; this bug appeared perhaps a year ago.

To briefly explain a use case for --select: I have an application w/ a "view directory in file browser"-type feature to allow the user to easily rename/move/etc a file. The --select feature is quite helpful, especially when there are a large number of files in the directory. The --new-window argument does work, but can be somewhat annoying if you end up running --select multiple times, especially for files in the same directory.