Skip to content

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

Open
camilasan wants to merge 1 commit intomasterfrom
bugfix/upgrade/foldericons
Open

fix(common): preserve Windows Explorer custom folder icons during migration.#9872
camilasan wants to merge 1 commit intomasterfrom
bugfix/upgrade/foldericons

Conversation

@camilasan
Copy link
Copy Markdown
Member

@camilasan camilasan commented Apr 20, 2026

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.

…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>
@camilasan
Copy link
Copy Markdown
Member Author

/backport to stable-3.17

@camilasan
Copy link
Copy Markdown
Member Author

/backport to stable-4.0

@github-actions
Copy link
Copy Markdown

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

Digest: sha256:e6fe46647e1a673046ff7440e7a0415de69c401a6147c009a5aaedad060ef6f9

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link

Copilot AI Apr 20, 2026

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants