Skip to content

doc: Naming convention for new QSettings setting names #295

Open
@hebasto

Description

@hebasto

On master (8f80092):

$ cat ~/.config/Bitcoin/Bitcoin-Qt.conf
[General]
MainWindowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\ta\0\0\0h\0\0\r\x18\0\0\x2\x86\0\0\ta\0\0\0\x80\0\0\r\x18\0\0\x2\x86\0\0\0\0\0\0\0\0\n\0\0\0\ta\0\0\0\x80\0\0\r\x18\0\0\x2\x86)
PeersTabSplitterSizes=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1\x12\xff\xff\xff\xff\0\xff\xff\xff\xff\x1\0\0\0\x1\0)
RPCConsoleWindowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\r[\0\0\x1\v\0\0\x10p\0\0\x2\xe7\0\0\r[\0\0\x1#\0\0\x10p\0\0\x2\xe7\0\0\0\0\0\0\0\0\n\0\0\0\r[\0\0\x1#\0\0\x10p\0\0\x2\xe7)
RecentRequestsViewHeaderState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x3\x90\0\0\0\x4\0\x1\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x82\0\0\0\x84\0\0\0\0\0\0\0\x4\0\0\0\x9e\0\0\0\x1\0\0\0\0\0\0\0\xb3\0\0\0\x1\0\0\0\0\0\0\x1\xa2\0\0\0\x1\0\0\0\0\0\0\0\x9d\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64)
TransactionViewHeaderState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\x2\x1\0\0\0\0\0\0\0\0\0\0\0\x6\x2\0\0\0\x1\0\0\0\x1\0\0\0\x64\0\0\x3\x96\0\0\0\x6\0\x1\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x17\0\0\0\x84\0\0\0\0\0\0\0\x6\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\xec\0\0\0\x1\0\0\0\0\0\0\x1~\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64)
UseEmbeddedMonospacedFont=true
addrProxy=127.0.0.1:9050
addrSeparateProxyTor=127.0.0.1:9050
bPrune=false
bSpendZeroConfChange=true
fCoinControlFeatures=false
fFeeSectionMinimized=true
fHideTrayIcon=false
fListen=true
fMinimizeOnClose=false
fMinimizeToTray=false
fReset=true
fRestartRequired=false
fUseNatpmp=false
fUseProxy=false
fUseSeparateProxyTor=false
fUseUPnP=false
language=
nConfTarget=6
nDatabaseCache=450
nDisplayUnit=1
nFeeRadio=0
nPruneSize=2
nSettingsVersion=219900
nSmartFeeSliderPosition=0
nThreadsScriptVerif=0
nTransactionFee=1000
strDataDir=/home/hebasto/.bitcoin
strThirdPartyTxUrls=

The ancient setting names follow Hungarian notation, except for addrProxy, addrSeparateProxyTor, and language.

Here are the changes since then:

Current suggestions in the open PRs:

Some observations:

  1. Widget geometry setting names follow the PascalCase (including open PRs), and the first parts of them point to the appropriate widgets
  2. Other setting names, e.g., display_unit in refactor: Make BitcoinUnits::Unit a scoped enum #60, follow the usual snake_case

It seems good for future code changes and maintenance to have explicit and documented naming conventions for new QSettings setting names before v22.0 branch off.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions