mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
macOS: QML ignores Bitcoin-Qt’s saved custom data directory #1076
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1076
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On macOS, QML’s legacy-settings reader opens a different preference domain from the one Bitcoin-Qt uses. As a result, QML fails to discover Bitcoin-Qt’s saved custom data directory and presents the storage-location page with Default selected.
This breaks the existing-profile adoption implemented in #742. The existing directory remains available and can be selected manually, but continuing with Default can initialize a separate node directory.
Steps to reproduce
-datadir.Actual behavior
QML does not recognize Bitcoin-Qt’s saved directory. It offers Default storage rather than adopting the existing custom location.
Expected behavior
QML should discover Bitcoin-Qt’s saved custom directory and treat it as an existing profile. First-run QML onboarding may still be necessary, but it should use that profile and preserve its settings.
Cause
Bitcoin-Qt sets its organization name to
Bitcoinand its organization domain tobitcoin.org. Its default-constructedQSettingstherefore uses this macOS preference domain:org.bitcoin.Bitcoin-QtIn
qml/legacy_settings_migration.cpp,OpenLegacyDataDirSettings()instead callsOpenSettings("Bitcoin", "Bitcoin-Qt"). That helper uses the explicit organization-name constructor, which does not inherit Bitcoin-Qt’s organization domain. Qt generates a.comdomain from the supplied name, so QML reads:com.bitcoin.Bitcoin-QtQmlDataDir::ReadGuiDataDirWithSource()consequently finds no legacystrDataDirand falls back to the default location.Linux uses the organization name directly, so this specific domain mismatch concerns native macOS preferences. The fix should preserve each platform’s existing settings identity.
Existing test coverage
legacyQtDataDirFallbackReadsOldQtSettingexplicitly tests that QML adopts the legacy directory. However, its fixture writes the preference using the same organization-name constructor as the reader. On macOS, both access the same incorrect domain, so the test does not establish compatibility with Bitcoin-Qt’s actual preferences.Coverage should create the legacy preference using Bitcoin-Qt’s organization name, domain and application name, then verify that QML discovers it.
Reproduced on merged
qt6at6e54a48ab571, macOS arm64, Qt 6.9.0. In isolated native-preference tests, installed Bitcoin-Qt 25.1 successfully opened a seeded custom-directory profile; after its clean shutdown, QML missed that same profile. A control placing the setting in the domain QML reads successfully opened the custom directory. The saved preference was seeded rather than created through Bitcoin-Qt’s chooser.Related: #704 and #742. The legacy lookup in the current #883 branch at
8e5b4d1f090astill uses the same organization-name constructor.