Review report

bitcoin-core/gui-qml: PR #1050

1 minor finding · 1 suggestion

Findings

Link

[minor] · Restoring the exact prune target leaves the current-setting card unchecked

On an existing prune=1907 profile, popup edits from 2 to 3 to 2 GB restore the exact target but leave Custom selected instead of the card marked “Your current setting.”

Location: qml/components/StorageOptions.qml:71 (head).

Details and suggested fix

With editable pruning and sufficient free space, open Storage settings on a profile configured with prune=1907, commit 3 GB, then commit 2 GB. PruneGBToMiB(2) restores exactly 1907 MiB, but both edits mark prune as touched and nothing clears that flag on equality. keepingCurrentStorage() therefore stays false, the Reduce card’s binding excludes it, and Custom becomes selected for the same target. The effective prune target is unchanged, and clicking the current-setting card recovers the keep state. The description leaves it unclear whether restoration requires that click rather than restoring the value. To support value-based restoration, compare the enabled mode and converted MiB target with the original setting, then clear the touched state on an exact match. Do not compare rounded GB values: 4096 MiB cannot round-trip through this input and should remain Custom.


Optional improvements

Link

[suggestion] · Database-cache errors present the integer type limit as guidance

Rejected editable database-cache input displays 2147483647 MiB as its upper bound, where a lower-bound-only message would provide clearer correction guidance.

Location: qml/models/options_model.cpp:317 (head).

Details and suggested fix

The new maximum correctly matches the pinned Core Qt GUI at bitcoin/src/qt/optionsdialog.cpp:98. However, parse and range failures now interpolate that type limit into “Enter a whole number between 4 and 2147483647 MiB,” even for an ordinary malformed entry. Keep the accepted range, but state only the useful lower bound in this error, such as “Enter a whole number of at least %1 MiB,” as the prune commit helper already does. This changes the guidance without changing which values are accepted.


Coverage details