Bug 503370 - "Open in File Manager" opens a wrong folder
Summary: "Open in File Manager" opens a wrong folder
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-OpenWith (other bugs)
Version First Reported In: 8.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-26 00:56 UTC by HubMiner
Modified: 2025-08-18 18:02 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HubMiner 2025-04-26 00:56:04 UTC
SUMMARY
"Open in File Manager" opens collection folder.
At the same time, Properties - File Properties - Folders, show the correct file folder for that image.

STEPS TO REPRODUCE
1. Starting from any of the modules: Album | People | Similarity, 
2. right clicking image,
3. clicking "Open in File Manager"

OBSERVED RESULT
Windows File Explorer opens the collection folder.

EXPECTED RESULT
Windows File Explorer should open the folder containing the image|video file, and select it.

SOFTWARE/OS VERSIONS
Windows 10
Comment 1 Maik Qualmann 2025-04-26 06:06:30 UTC
I use this function frequently on Windows, and it definitely opens the corresponding folder and selects the file.

Please create a DebugView log as described here for Windows:

https://www.digikam.org/contribute/#windows-host

Please start the log entirely from the digiKam startup.

Maik
Comment 2 HubMiner 2025-04-26 16:02:22 UTC
How can I share the log without making it publically available?
Comment 3 caulier.gilles 2025-04-26 20:23:49 UTC
You can send the log file by private mail to Maik at metzpinguin@gmail.com

Best Regards

Gilles Caulier
Comment 4 HubMiner 2025-04-26 21:44:13 UTC
Thank you, sent.
Comment 5 HubMiner 2025-04-30 22:41:22 UTC
Info provided in direct email to Maik.
Comment 6 Maik Qualmann 2025-05-02 05:56:20 UTC
Hmm, I didn't receive anything. I'll have to check my spam folder later...

Maik
Comment 7 HubMiner 2025-07-28 20:40:01 UTC
The issue still exists in 8.7
Some files/folders are opening fine, some are opening at the top of a collection.

I renamed a folder for one of the affected file.  Presumably it refreshed DB so that it started opening the file's folder correctly.  Curiously, looking at Properties panel and "File Properties" section, still shows a correct Folder.
Comment 8 Maik Qualmann 2025-07-29 06:10:05 UTC
The log you sent me ended up in my spam folder; I didn't see it until later. The log didn't show anything unusual, though. They used two characters in the path that were rather unusual to me (+ and =), but these characters aren't forbidden in file paths. I tried to recreate it, but it always opened the correct directory and selected the file in Explorer.

You can try to see if it works for you from the Command Prompt:

Try in cmd.exe: (Comma after /select is correct)

explorer.exe /select, PATH_TO_IMAGE

explorer.exe /select, F:/syncthing/mars+venus/Photo_Library/=Triage_Photos/3-To-Triage-Photo/2021/2021-06-15/20210615_141850.JPG

Maik
Comment 9 Maik Qualmann 2025-07-29 07:46:31 UTC
I had not posted the path separator correctly, this would be correct:

explorer.exe /select, F:\syncthing\mars+venus\Photo_Library\=Triage_Photos\3-To-Triage-Photo\2021\2021-06-15\20210615_141850.JPG

Maik
Comment 10 HubMiner 2025-07-30 12:10:01 UTC
I tested the explorer command: it looks like Windows treats PLUS and EQUALS as semi-special chars and it expects such Paths to be double quoted.  Please consider patching the way DK opens the Explorer window.


TEST SETUP:
Using git-bash

mkdir -p 'F:\syncthing\mars+venus\apps\pinginfoview'
cd 'F:\syncthing\mars+venus\apps\pinginfoview'
mkdir +test =test
cd +test
touch +file.txt '= file plus space.txt' =file.txt 'file with a space.txt' file.txt
cd ..
cd =test
touch +file.txt '= file plus space.txt' =file.txt 'file with a space.txt' file.txt
cd ..
find . | grep test


TEST STEPS

explorer.exe /select, F:\syncthing\mars+venus\apps\pinginfoview\=test\NON-EXISTING-FILE.txt
- BAD: opens Desktop.  Observation for following tests: whenever Desktop is opened - the target file did not exist.

explorer.exe /select, F:\syncthing\mars+venus\apps\pinginfoview\=test\file.txt
- BAD: opens pinginfoview (parent of a parent)

explorer.exe /select, "F:\syncthing\mars+venus\apps\pinginfoview\=test\file.txt"
- GOOD

explorer.exe /select, F:\syncthing\mars+venus\apps\pinginfoview\+test\file.txt
- BAD: opens Documents

explorer.exe /select, "F:\syncthing\mars+venus\apps\pinginfoview\+test\file.txt"
- GOOD

explorer.exe /select, "F:\syncthing\mars+venus\apps\pinginfoview\+test\= file plus space.txt"
- GOOD
Comment 11 Maik Qualmann 2025-07-30 16:15:22 UTC
Git commit ec482dee698bce44bf679250b4f44397dd446f7f by Maik Qualmann.
Committed on 30/07/2025 at 16:14.
Pushed by mqualmann into branch 'master'.

add quotation marks to the Windows path if there are no spaces
Qt adds quotation marks if there are spaces.

M  +9    -1    core/libs/threadimageio/engine/dfileoperations.cpp

https://invent.kde.org/graphics/digikam/-/commit/ec482dee698bce44bf679250b4f44397dd446f7f
Comment 12 Maik Qualmann 2025-08-01 19:49:21 UTC
A digiKam version with the fix is available. Can the problem still be reproduced?

https://files.kde.org/digikam/

Maik
Comment 13 Maik Qualmann 2025-08-13 08:49:26 UTC
*** Bug 508191 has been marked as a duplicate of this bug. ***
Comment 14 Maik Qualmann 2025-08-13 10:34:34 UTC
Git commit 744a2057da15c935f941435e84e5056b0a6157f3 by Maik Qualmann.
Committed on 13/08/2025 at 10:33.
Pushed by mqualmann into branch 'master'.

use native Windows command arguments

M  +8    -13   core/libs/threadimageio/engine/dfileoperations.cpp

https://invent.kde.org/graphics/digikam/-/commit/744a2057da15c935f941435e84e5056b0a6157f3
Comment 15 Maik Qualmann 2025-08-18 18:02:06 UTC
I've tested all possible cases here, and Explorer now always opens the correct folder and selects the file. I'm closing this bug. If you still encounter problems, please reopen it with a DebugView log and the exact path.

Maik