Skip to content

fix(common): preserve Windows Explorer custom folder icons during migration. - #9872

Merged
mgallien merged 1 commit into
masterfrom
bugfix/upgrade/foldericons
Jun 9, 2026
Merged

fix(common): preserve Windows Explorer custom folder icons during migration.#9872
mgallien merged 1 commit into
masterfrom
bugfix/upgrade/foldericons

Conversation

@camilasan

@camilasan camilasan commented Apr 20, 2026

Copy link
Copy Markdown
Member

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.

🤖 AI used... humans were harmed while fixing this bug.

@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-3.17

@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-4.0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the comment: "overwritte" should be "overwrite".

Suggested change
// 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

Copilot uses AI. Check for mistakes.
@sonarqubecloud

Copy link
Copy Markdown

…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 <[email protected]>
@mgallien
mgallien force-pushed the bugfix/upgrade/foldericons branch from 85b8860 to 084f545 Compare June 9, 2026 12:17
@mgallien
mgallien enabled auto-merge June 9, 2026 12:18
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-9872.zip

Digest: sha256:840eccc22aa26414eff6dbb091180ee81f9b184559a3e926f3841b37763b2da5

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.

@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@mgallien
mgallien merged commit c5537f5 into master Jun 9, 2026
20 of 23 checks passed
@mgallien
mgallien deleted the bugfix/upgrade/foldericons branch June 9, 2026 13:00
@mgallien

mgallien commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable-33.0 please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants