Bug 487925 - "Open in File Manager" just opens Windows Explorer and not the folder
Summary: "Open in File Manager" just opens Windows Explorer and not the folder
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Menus (other bugs)
Version First Reported In: 8.3.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-02 14:14 UTC by testvonmir
Modified: 2024-06-10 06:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.4.0
Sentry Crash Report:


Attachments
digikam collections (29.33 KB, image/png)
2024-06-09 09:21 UTC, testvonmir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description testvonmir 2024-06-02 14:14:40 UTC
SUMMARY
When trying to open the folder containing an image in an album, it just opens Windows Explorer.

STEPS TO REPRODUCE
1. Right-click on a thumbnail in digikams Album View
2. Select "Open in File Manager"

OBSERVED RESULT
Windows Explorer opens, but just in the "normal/base" view in "This PC".

EXPECTED RESULT
It should open the folder containing the image, not just Windows Explorer

ADDITIONAL INFORMATION
How can I find out where the problem lies - on digikams side or in Windows?
Tested on digikam 8.2.0 and on 8.3.0

System: Windows 10 Pro 22H2, build 19045.4474
Comment 1 caulier.gilles 2024-06-02 14:30:12 UTC
It's reproducible with 8.4.0 pre-release ?

https://files.kde.org/digikam/
Comment 2 Maik Qualmann 2024-06-02 14:51:56 UTC
I can't reproduce the problem here. Explorer opens in the directory where the image is located and selects it. We use the following command, you can test it in the CMD:

explorer /select file\path\to\the\image

Maik
Comment 3 Maik Qualmann 2024-06-03 06:31:02 UTC
Git commit 6e1b64e4d8511f038b76488b63b59c1f71b9d6b0 by Maik Qualmann.
Committed on 03/06/2024 at 06:30.
Pushed by mqualmann into branch 'master'.

change the Explorer call without space between the arguments

M  +7    -5    core/libs/threadimageio/engine/dfileoperations.cpp

https://invent.kde.org/graphics/digikam/-/commit/6e1b64e4d8511f038b76488b63b59c1f71b9d6b0
Comment 4 testvonmir 2024-06-03 11:44:45 UTC
Hi again,

thanks for the fast replies. I haven’t tested it with digikam 8.4.0; but I have tested the command Maik provided in his reply.
I noticed that there is a missing “,” after the select option and without that it was not working for me. Adding this, the command works for me (at least on another pc I just used to test it).
As far as I understand the commit linked below, it also contains changes regarding the explorer command. Is it still necessary that I test this behaviour in digikam 8.4.0?
Comment 5 Maik Qualmann 2024-06-03 12:54:53 UTC
Yes, I forgot to write the comma. Please test the digiKam-8.4.0 from today (06/03/2024) again. It works here without any problems, even with file paths that contain spaces.

Maik
Comment 6 testvonmir 2024-06-09 09:21:28 UTC
Created attachment 170286 [details]
digikam collections
Comment 7 testvonmir 2024-06-09 09:22:53 UTC
(In reply to Maik Qualmann from comment #5)
> Yes, I forgot to write the comma. Please test the digiKam-8.4.0 from today
> (06/03/2024) again. It works here without any problems, even with file paths
> that contain spaces.
> 
> Maik

Hi again,

I just tested it again on my PC and it still doesn't work for me with the current version of digikam (I downloaded digiKam-8.4.0-20240608T115145-Qt6-Win64.exe).
I tested the command in the command-line and it works without problems there.

But I have an idea where the issue comes from or when it first occured because this feature worked for me in the past.
My images are saved on a network drive in my home network. I have mounted this drive under letter B: on my computer. I recently changed the category of my image folder in the settings from a local collection to a collection on a network share because from what I understood that would be of advantage at least in some cases. Before changing, my images collection also was listed under "Local Collections", now it is shown under "Collections on Network Shares", see attached picture.
I still have another collection in digikam for Thumbnail/category icons ("Thumbs") which is located on my computers hard drive. When I try to open an image from this collection, it also works without a problem.

I tried cleaning the database with the Maintenance tool, but that did not help. What can I do to investigate further?

Regards
Comment 8 Maik Qualmann 2024-06-09 09:52:26 UTC
Yes, with such a virtual drive letter I can reproduce it.

Maik
Comment 9 Maik Qualmann 2024-06-09 10:45:41 UTC
Git commit 094de372bf389a83172c55d7b74a66742fc803e8 by Maik Qualmann.
Committed on 09/06/2024 at 10:45.
Pushed by mqualmann into branch 'master'.

try to start Explorer in a CMD environment

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

https://invent.kde.org/graphics/digikam/-/commit/094de372bf389a83172c55d7b74a66742fc803e8
Comment 10 caulier.gilles 2024-06-09 12:47:56 UTC
to testvonmir@web.de

The Windows installer is up-to-date at usual place. Please try with the new Maik patch:

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

Gilles Caulier
Comment 11 Maik Qualmann 2024-06-09 13:01:36 UTC
Unfortunately, the behavior has not changed. Normal drives work, including network drives that are accessed via UNC path (\\SERVERNAME\SHARE\). But a network path via assigned drive letter does not work. I have no idea at the moment.

Maik
Comment 12 Maik Qualmann 2024-06-09 13:37:37 UTC
We probably have to resolve the real path using the Windows API and the GetFullPathName function. We will first try using the corresponding QFileInfo functions.

Maik
Comment 13 Maik Qualmann 2024-06-09 13:42:48 UTC
Git commit 86042362ea49be74bea9610f6feb358ae88ba779 by Maik Qualmann.
Committed on 09/06/2024 at 13:42.
Pushed by mqualmann into branch 'master'.

try to resolve the file path

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

https://invent.kde.org/graphics/digikam/-/commit/86042362ea49be74bea9610f6feb358ae88ba779
Comment 14 caulier.gilles 2024-06-09 13:53:35 UTC
New Windows build under progress...
Comment 15 Maik Qualmann 2024-06-09 14:46:13 UTC
The last change works. The reason is that we have one slash too many in an album root of B:/. The FileInfo function clears this up, so it works now. We have to look at which point in the CollectionManager we suppress this slash so that nothing breaks. I think it is best to remove this slash when creating the collection.

Maik
Comment 16 Maik Qualmann 2024-06-09 17:06:55 UTC
Git commit 193543c434aa83602170d3d716c33a4bafa22479 by Maik Qualmann.
Committed on 09/06/2024 at 17:06.
Pushed by mqualmann into branch 'master'.

fix double slash in a network drive letter collection

M  +2    -1    core/libs/database/collection/collectionmanager_location.cpp
M  +1    -4    core/libs/threadimageio/engine/dfileoperations.cpp

https://invent.kde.org/graphics/digikam/-/commit/193543c434aa83602170d3d716c33a4bafa22479
Comment 17 Maik Qualmann 2024-06-09 19:41:05 UTC
Git commit cb77a85a8979925a0a3d1d5fa3c517d50188b7bd by Maik Qualmann.
Committed on 09/06/2024 at 19:40.
Pushed by mqualmann into branch 'master'.

Revert "fix double slash in a network drive letter collection"

M  +1    -2    core/libs/database/collection/collectionmanager_location.cpp
M  +4    -1    core/libs/threadimageio/engine/dfileoperations.cpp

https://invent.kde.org/graphics/digikam/-/commit/cb77a85a8979925a0a3d1d5fa3c517d50188b7bd
Comment 18 testvonmir 2024-06-09 19:51:50 UTC
I just wanted to report that with digiKam-8.4.0-20240609T183305-Qt6-Win64 "Open in File Manager" works for me - as expected from your comments.
But since you reverted your last commit, I guess there are issues or at least things which need to be clarified.

Please let me know if I can help here or test something more.
Comment 19 Maik Qualmann 2024-06-09 20:45:56 UTC
Git commit 763d2ac218aa2178a8fb2f21f97b302a19f70f27 by Maik Qualmann.
Committed on 09/06/2024 at 20:45.
Pushed by mqualmann into branch 'master'.

fix double slash in a network drive letter collection #2

M  +10   -4    core/libs/database/collection/collectionmanager_location.cpp

https://invent.kde.org/graphics/digikam/-/commit/763d2ac218aa2178a8fb2f21f97b302a19f70f27
Comment 20 Maik Qualmann 2024-06-10 06:39:46 UTC
Git commit 5a2e3b14bfd5d5d8a778350664f7c2ddb60fd377 by Maik Qualmann.
Committed on 10/06/2024 at 06:38.
Pushed by mqualmann into branch 'master'.

prevent path with slash at the end when creating the collection
FIXED-IN: 8.4.0

M  +1    -1    NEWS
M  +3    -8    core/libs/database/collection/collectionmanager_location.cpp
M  +4    -0    core/utilities/setup/collections/setupcollectionview.cpp

https://invent.kde.org/graphics/digikam/-/commit/5a2e3b14bfd5d5d8a778350664f7c2ddb60fd377