Bug 432100 - Unable to rename a album with subfolders under Windows
Summary: Unable to rename a album with subfolders under Windows
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-MainView (show other bugs)
Version: 7.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-25 15:46 UTC by Tyson Tan
Modified: 2023-05-04 02:16 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2021-01-25 15:46:12 UTC
Under Windows, digiKam cannot rename a folder from Left-Sidebar's Album tab, if the folder has a subfolder.

For example, if:
Root Album = ~/HOME/Pictures
Full Path = ~HOME/Pictures/Folder-A/Folder-B
Under Windows, I won't be able to rename Folder-A from digiKam's Left-Sidebar's Album tab. However, I can do so under Linux.

It's also worth mention that although I can rename Folder-A from Windows File Manager, digiKam will take unusually long time to scan the change upon next restart. It's longer than a fresh scan for some reason, making the users extrememly unwilling to use Windows File Manager as a work around.

This bug was reported to me by my local community because I've taken over the task of completely retranslating digiKam into Simplified Chinese. It's said this bug has been around for at least 10 years now...
Comment 1 Maik Qualmann 2021-01-25 17:28:12 UTC
Just tested again, no problems with renaming albums, even with a large number of nested subfolders. We know the problem, but we will not be able to solve it at the moment. The problem is file locking on Windows. Qt uses a low level file API that cannot handle locked files. The following conditions must be met so that there are no problems with digiKam:
- Album monitoring in digiKam must be deactivated.
- Folders must not be part of a Windows file or network share.
- Folders or pictures must not be open in other programs such as Explorer or similar.

Maik
Comment 2 Tyson Tan 2021-01-25 19:03:30 UTC
Thank you Maik, please allow me to translate your note here so the local community can read.

以下是 Maik 的回复,专门翻译给中文用户参考:
我刚刚进行了测试,重命名相册其实是可以的,即使有很多子相册也是可以的。你说的情况我们早已知道,但目前没有办法解决。你遇到的问题是由于 Windows 的文件锁定机制与 Qt 不兼容所造成的。Qt 使用了一种无法处理 Windows 文件锁定的 API。要想在 Windows 下面正常在 digiKam 里面对含有子文件夹的相册进行重命名,必须满足这些条件:
- 监视相册外部更改功能必须关闭。
- 文件夹不能是 Windows 系统文件夹,也不能是网络共享路径。
- 文件夹和它的图像不能被其他程序打开,包括 Windows 文件资源管理器在内。
Comment 3 Tyson Tan 2021-01-25 19:13:01 UTC
I've tested it on Windows 10, I can confirm that it worked fine with Maik's instruction.

我刚刚在 Windows 10 上测试过,的确如 Maik 所言,只要不打开文件管理器,digiKam 就能在左侧栏的相册标签页中对含有子文件夹的相册正常进行重命名了。

@Maik
Shall we mark this bug report as resolved/upstream or shall we keep it open?
Comment 4 Maik Qualmann 2021-01-25 19:38:47 UTC
We'll leave the bug report open, I'll change the title a little. We should show an error window on Windows when renaming fails with hints.
Only one example with Windows file locking today at work. A PDF exported with Libre Office which was opened in the background with Adobe reader could not be exported again. Locking problem is common in Windows.

Maik
Comment 5 Tyson Tan 2021-01-25 19:58:39 UTC
Thanks Maik. File locking also caused problems for Krita's save mechanism in the past. Hopefully it'll got better someday.
Comment 6 caulier.gilles 2021-01-25 21:24:48 UTC
yes, Maik,

The file locking mechanism under Windows is just the hell. I already experienced this problem in my office.

Gilles
Comment 7 caulier.gilles 2023-04-30 08:15:47 UTC
#Tyson

digiKam 8.0.0 is out. This entry still valid with this release ?

Best regards

Gilles Caulier
Comment 8 Tyson Tan 2023-05-04 00:34:47 UTC
Hi Gilles, I reported this bug as an agent of the community, but I don't use Windows myself. I have forgotten everything after so many years. I'm sorry.
Comment 9 caulier.gilles 2023-05-04 02:16:20 UTC
Git commit e019e5cafcef5199e4f44abff671c73d40489cd1 by Gilles Caulier.
Committed on 04/05/2023 at 02:14.
Pushed by cgilles into branch 'master'.

add note about Windows file locking in Online Documentation
FIXED-IN: 8.1.0

M  +8    -0    main_window/albums_view.rst

https://invent.kde.org/documentation/digikam-doc/commit/e019e5cafcef5199e4f44abff671c73d40489cd1