HomePhabricator

gui: simplify wallet_model creation

Description

gui: simplify wallet_model creation

Summary:
For Core, this commit removed a warning when building without the wallet, because the wallet_model nullptr was defined outside of the #ifdef ENABLE_WALLET context. This problem was already fixed by D4661 in Bitcoin ABC.

So this is a simple refactoring that simplifies the code.

Quote from the PR conversation:

accessing the current element of a combox-box using QComboBox::currentData() instead of using the index is possible since Qt 5.2

This is a backport of Core PR17939

Test Plan:
ninja && ninja check && src/qt/bitcoin-qt

In the RPC console, type a wallet related command and press enter while the line edit is the active widget.

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8619

Details

Provenance
João Barbosa <joao.paulo.barbosa@gmail.com>Authored on Dec 7 2020, 16:16
PiRKCommitted on Dec 7 2020, 16:17
abc-botPushed on Dec 7 2020, 16:23
Reviewer
Restricted Project
Differential Revision
D8619: gui: simplify wallet_model creation
Parents
rABC24a934664504: Refactor: clean up PeriodicFlush()
Branches
Unknown
Tags
Unknown