fix(common): preserve Windows Explorer custom folder icons during migration.#9872
fix(common): preserve Windows Explorer custom folder icons during migration.#9872
Conversation
…ration. Check the encoding of the Desktop.ini file to determine if it should be overwritten or preserved: - Windows Explorer writes Desktop.ini in UTF-16LE (custom icon), - While the client always writes UTF-8 (default icon). Fixes the regression introduced by d60c760. Signed-off-by: Camila Ayres <hello@camilasan.com>
|
/backport to stable-3.17 |
|
/backport to stable-4.0 |
|
Artifact containing the AppImage: nextcloud-appimage-pr-9872.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
There was a problem hiding this comment.
Pull request overview
Updates Windows Desktop.ini migration behavior to preserve custom folder icons set by Windows Explorer by detecting UTF-16 encoded Desktop.ini files and avoiding overwriting them during migration.
Changes:
- Detect Desktop.ini encoding via BOM read (UTF-16 vs non-UTF-16) during migration.
- Preserve UTF-16 Desktop.ini files (assumed Explorer-managed/custom icon) and only overwrite non-UTF-16 files.
- Add warning logs for unreadable Desktop.ini during migration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| qCWarning(lcUtility) << desktopIni.fileName() << "is UTF-16 encoded (Windows Explorer custom icon), preserving it."; | ||
| return; | ||
| } | ||
| // If the file is not UTF-16 encoded, we assume it is not a custom icon: overwritte it with the new icon and set the localized resource name |
There was a problem hiding this comment.
Typo in the comment: "overwritte" should be "overwrite".
| // If the file is not UTF-16 encoded, we assume it is not a custom icon: overwritte it with the new icon and set the localized resource name | |
| // If the file is not UTF-16 encoded, we assume it is not a custom icon: overwrite it with the new icon and set the localized resource name |
|



Check the encoding of the Desktop.ini file to determine if it should be overwritten or preserved:
Fixes the regression introduced by d60c760.
🤖 AI used... humans were harmed while fixing this bug.