Skip to content

Commit 2542a3e

Browse files
hebastoknst
authored andcommitted
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#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
1 parent f1795e2 commit 2542a3e

Some content is hidden

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

61 files changed

+118
-175
lines changed

src/.clang-tidy

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

src/qt/addressbookpage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
6767
AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
6868
QDialog(parent, GUIUtil::dialog_flags),
6969
ui(new Ui::AddressBookPage),
70-
model(nullptr),
7170
mode(_mode),
7271
tab(_tab)
7372
{

src/qt/addressbookpage.h

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

4949
private:
5050
Ui::AddressBookPage *ui;
51-
AddressTableModel *model;
51+
AddressTableModel* model{nullptr};
5252
Mode mode;
5353
Tabs tab;
5454
QString returnValue;

src/qt/askpassphrasedialog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
2525
QDialog(parent, GUIUtil::dialog_flags),
2626
ui(new Ui::AskPassphraseDialog),
2727
mode(_mode),
28-
model(nullptr),
29-
fCapsLock(false),
3028
m_passphrase_out(passphrase_out)
3129
{
3230
ui->setupUi(this);

src/qt/askpassphrasedialog.h

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

4646
private Q_SLOTS:

src/qt/bitcoin.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,8 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
231231
static int qt_argc = 1;
232232
static const char* qt_argv = "dash-qt";
233233

234-
BitcoinApplication::BitcoinApplication():
235-
QApplication(qt_argc, const_cast<char **>(&qt_argv)),
236-
optionsModel(nullptr),
237-
clientModel(nullptr),
238-
window(nullptr),
239-
pollShutdownTimer(nullptr),
240-
returnValue(0)
234+
BitcoinApplication::BitcoinApplication()
235+
: QApplication(qt_argc, const_cast<char**>(&qt_argv))
241236
{
242237
RegisterMetaTypes();
243238
// Qt runs setlocale(LC_ALL, "") on initialization.

src/qt/bitcoin.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ public Q_SLOTS:
9393

9494
private:
9595
std::optional<InitExecutor> m_executor;
96-
OptionsModel *optionsModel;
97-
ClientModel *clientModel;
98-
BitcoinGUI *window;
99-
QTimer *pollShutdownTimer;
96+
OptionsModel* optionsModel{nullptr};
97+
ClientModel* clientModel{nullptr};
98+
BitcoinGUI* window{nullptr};
99+
QTimer* pollShutdownTimer{nullptr};
100100
#ifdef ENABLE_WALLET
101101
PaymentServer* paymentServer{nullptr};
102102
WalletController* m_wallet_controller{nullptr};
103103
#endif
104-
int returnValue;
104+
int returnValue{0};
105105
std::unique_ptr<QWidget> shutdownWindow;
106106
SplashScreen* m_splash = nullptr;
107107
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
@@ -185,9 +185,8 @@ class AmountLineEdit: public QLineEdit
185185

186186
#include <qt/bitcoinamountfield.moc>
187187

188-
BitcoinAmountField::BitcoinAmountField(QWidget *parent) :
189-
QWidget(parent),
190-
amount(nullptr)
188+
BitcoinAmountField::BitcoinAmountField(QWidget* parent)
189+
: QWidget(parent)
191190
{
192191
amount = new AmountLineEdit(this);
193192
amount->setLocale(QLocale::c());

src/qt/bitcoinamountfield.h

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

7474
private:
75-
AmountLineEdit *amount;
75+
AmountLineEdit* amount{nullptr};
7676
BitcoinUnits *units;
7777

7878
void unitChanged(int idx);

src/qt/bitcoingui.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,9 +2144,7 @@ bool BitcoinGUI::isPrivacyModeActivated() const
21442144
return m_mask_values_action->isChecked();
21452145
}
21462146

2147-
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
2148-
optionsModel(nullptr),
2149-
menu(nullptr)
2147+
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl()
21502148
{
21512149
createContextMenu();
21522150
setToolTip(tr("Unit to show amounts in. Click to select another unit."));

0 commit comments

Comments
 (0)