Skip to content

Commit b7f6a89

Browse files
committed
Merge bitcoin-core/gui#686: clang-tidy: Force checks for headers in src/qt
7b7cd11 clang-tidy, qt: Force checks for headers in `src/qt` (Hennadii Stepanov) 69eacf2 clang-tidy, qt: Fix `modernize-use-default-member-init` in headers (Hennadii Stepanov) Pull request description: This PR split from bitcoin/bitcoin#26705 and contains only changes in `src/qt`. Effectively, it fixes the clang-tidy's `modernize-use-default-member-init` errors, and forces clang-tidy checks for all headers in the `src/qt` directory. ACKs for top commit: jarolrod: ACK 7b7cd11 Tree-SHA512: 79525bb0f31ae7cad88c781e55091a21467c0485ddc1ed03ad62e051480fda3b3710619ea11af480437edba3c6e038f7c40edc6b373e3a37408c006d11b34686
2 parents 10a5f19 + 7b7cd11 commit b7f6a89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+109
-167
lines changed

src/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ readability-redundant-string-init,
2828
CheckOptions:
2929
- key: performance-move-const-arg.CheckTriviallyCopyableMove
3030
value: false
31+
HeaderFilterRegex: './qt'

src/qt/addressbookpage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
6464
AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) :
6565
QDialog(parent, GUIUtil::dialog_flags),
6666
ui(new Ui::AddressBookPage),
67-
model(nullptr),
6867
mode(_mode),
6968
tab(_tab)
7069
{

src/qt/addressbookpage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public Q_SLOTS:
4949

5050
private:
5151
Ui::AddressBookPage *ui;
52-
AddressTableModel *model;
52+
AddressTableModel* model{nullptr};
5353
Mode mode;
5454
Tabs tab;
5555
QString returnValue;

src/qt/askpassphrasedialog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
2323
QDialog(parent, GUIUtil::dialog_flags),
2424
ui(new Ui::AskPassphraseDialog),
2525
mode(_mode),
26-
model(nullptr),
27-
fCapsLock(false),
2826
m_passphrase_out(passphrase_out)
2927
{
3028
ui->setupUi(this);

src/qt/askpassphrasedialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class AskPassphraseDialog : public QDialog
3838
private:
3939
Ui::AskPassphraseDialog *ui;
4040
Mode mode;
41-
WalletModel *model;
42-
bool fCapsLock;
41+
WalletModel* model{nullptr};
42+
bool fCapsLock{false};
4343
SecureString* m_passphrase_out;
4444

4545
private Q_SLOTS:

src/qt/bitcoin.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,8 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
228228
static int qt_argc = 1;
229229
static const char* qt_argv = "bitcoin-qt";
230230

231-
BitcoinApplication::BitcoinApplication():
232-
QApplication(qt_argc, const_cast<char **>(&qt_argv)),
233-
optionsModel(nullptr),
234-
clientModel(nullptr),
235-
window(nullptr),
236-
pollShutdownTimer(nullptr),
237-
returnValue(0),
238-
platformStyle(nullptr)
231+
BitcoinApplication::BitcoinApplication()
232+
: QApplication(qt_argc, const_cast<char**>(&qt_argv))
239233
{
240234
// Qt runs setlocale(LC_ALL, "") on initialization.
241235
RegisterMetaTypes();

src/qt/bitcoin.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ public Q_SLOTS:
9696

9797
private:
9898
std::optional<InitExecutor> m_executor;
99-
OptionsModel *optionsModel;
100-
ClientModel *clientModel;
101-
BitcoinGUI *window;
102-
QTimer *pollShutdownTimer;
99+
OptionsModel* optionsModel{nullptr};
100+
ClientModel* clientModel{nullptr};
101+
BitcoinGUI* window{nullptr};
102+
QTimer* pollShutdownTimer{nullptr};
103103
#ifdef ENABLE_WALLET
104104
PaymentServer* paymentServer{nullptr};
105105
WalletController* m_wallet_controller{nullptr};
106106
#endif
107-
int returnValue;
108-
const PlatformStyle *platformStyle;
107+
int returnValue{0};
108+
const PlatformStyle* platformStyle{nullptr};
109109
std::unique_ptr<QWidget> shutdownWindow;
110110
SplashScreen* m_splash = nullptr;
111111
std::unique_ptr<interfaces::Node> m_node;

src/qt/bitcoinamountfield.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ class AmountSpinBox: public QAbstractSpinBox
217217

218218
#include <qt/bitcoinamountfield.moc>
219219

220-
BitcoinAmountField::BitcoinAmountField(QWidget *parent) :
221-
QWidget(parent),
222-
amount(nullptr)
220+
BitcoinAmountField::BitcoinAmountField(QWidget* parent)
221+
: QWidget(parent)
223222
{
224223
amount = new AmountSpinBox(this);
225224
amount->setLocale(QLocale::c());

src/qt/bitcoinamountfield.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class BitcoinAmountField: public QWidget
7474
bool eventFilter(QObject *object, QEvent *event) override;
7575

7676
private:
77-
AmountSpinBox *amount;
77+
AmountSpinBox* amount{nullptr};
7878
QValueComboBox *unit;
7979

8080
private Q_SLOTS:

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,10 +1541,8 @@ bool BitcoinGUI::isPrivacyModeActivated() const
15411541
return m_mask_values_action->isChecked();
15421542
}
15431543

1544-
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
1545-
: optionsModel(nullptr),
1546-
menu(nullptr),
1547-
m_platform_style{platformStyle}
1544+
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle* platformStyle)
1545+
: m_platform_style{platformStyle}
15481546
{
15491547
createContextMenu();
15501548
setToolTip(tr("Unit to show amounts in. Click to select another unit."));

0 commit comments

Comments
 (0)