0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00

clang-tidy, qt: Fix modernize-use-default-member-init in headers

See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html
This commit is contained in:
Hennadii Stepanov 2022-12-16 11:58:38 +00:00
parent 5055d07edf
commit 69eacf2c5e
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
61 changed files with 108 additions and 167 deletions

View file

@ -64,7 +64,6 @@ protected:
AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) : AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AddressBookPage), ui(new Ui::AddressBookPage),
model(nullptr),
mode(_mode), mode(_mode),
tab(_tab) tab(_tab)
{ {

View file

@ -49,7 +49,7 @@ public Q_SLOTS:
private: private:
Ui::AddressBookPage *ui; Ui::AddressBookPage *ui;
AddressTableModel *model; AddressTableModel* model{nullptr};
Mode mode; Mode mode;
Tabs tab; Tabs tab;
QString returnValue; QString returnValue;

View file

@ -23,8 +23,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AskPassphraseDialog), ui(new Ui::AskPassphraseDialog),
mode(_mode), mode(_mode),
model(nullptr),
fCapsLock(false),
m_passphrase_out(passphrase_out) m_passphrase_out(passphrase_out)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -38,8 +38,8 @@ public:
private: private:
Ui::AskPassphraseDialog *ui; Ui::AskPassphraseDialog *ui;
Mode mode; Mode mode;
WalletModel *model; WalletModel* model{nullptr};
bool fCapsLock; bool fCapsLock{false};
SecureString* m_passphrase_out; SecureString* m_passphrase_out;
private Q_SLOTS: private Q_SLOTS:

View file

@ -228,14 +228,8 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
static int qt_argc = 1; static int qt_argc = 1;
static const char* qt_argv = "bitcoin-qt"; static const char* qt_argv = "bitcoin-qt";
BitcoinApplication::BitcoinApplication(): BitcoinApplication::BitcoinApplication()
QApplication(qt_argc, const_cast<char **>(&qt_argv)), : QApplication(qt_argc, const_cast<char**>(&qt_argv))
optionsModel(nullptr),
clientModel(nullptr),
window(nullptr),
pollShutdownTimer(nullptr),
returnValue(0),
platformStyle(nullptr)
{ {
// Qt runs setlocale(LC_ALL, "") on initialization. // Qt runs setlocale(LC_ALL, "") on initialization.
RegisterMetaTypes(); RegisterMetaTypes();

View file

@ -97,16 +97,16 @@ protected:
private: private:
std::optional<InitExecutor> m_executor; std::optional<InitExecutor> m_executor;
OptionsModel *optionsModel; OptionsModel* optionsModel{nullptr};
ClientModel *clientModel; ClientModel* clientModel{nullptr};
BitcoinGUI *window; BitcoinGUI* window{nullptr};
QTimer *pollShutdownTimer; QTimer* pollShutdownTimer{nullptr};
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
PaymentServer* paymentServer{nullptr}; PaymentServer* paymentServer{nullptr};
WalletController* m_wallet_controller{nullptr}; WalletController* m_wallet_controller{nullptr};
#endif #endif
int returnValue; int returnValue{0};
const PlatformStyle *platformStyle; const PlatformStyle* platformStyle{nullptr};
std::unique_ptr<QWidget> shutdownWindow; std::unique_ptr<QWidget> shutdownWindow;
SplashScreen* m_splash = nullptr; SplashScreen* m_splash = nullptr;
std::unique_ptr<interfaces::Node> m_node; std::unique_ptr<interfaces::Node> m_node;

View file

@ -217,9 +217,8 @@ Q_SIGNALS:
#include <qt/bitcoinamountfield.moc> #include <qt/bitcoinamountfield.moc>
BitcoinAmountField::BitcoinAmountField(QWidget *parent) : BitcoinAmountField::BitcoinAmountField(QWidget* parent)
QWidget(parent), : QWidget(parent)
amount(nullptr)
{ {
amount = new AmountSpinBox(this); amount = new AmountSpinBox(this);
amount->setLocale(QLocale::c()); amount->setLocale(QLocale::c());

View file

@ -74,7 +74,7 @@ protected:
bool eventFilter(QObject *object, QEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override;
private: private:
AmountSpinBox *amount; AmountSpinBox* amount{nullptr};
QValueComboBox *unit; QValueComboBox *unit;
private Q_SLOTS: private Q_SLOTS:

View file

@ -1541,10 +1541,8 @@ bool BitcoinGUI::isPrivacyModeActivated() const
return m_mask_values_action->isChecked(); return m_mask_values_action->isChecked();
} }
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle) UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle* platformStyle)
: optionsModel(nullptr), : m_platform_style{platformStyle}
menu(nullptr),
m_platform_style{platformStyle}
{ {
createContextMenu(); createContextMenu();
setToolTip(tr("Unit to show amounts in. Click to select another unit.")); setToolTip(tr("Unit to show amounts in. Click to select another unit."));

View file

@ -333,8 +333,8 @@ protected:
void changeEvent(QEvent* e) override; void changeEvent(QEvent* e) override;
private: private:
OptionsModel *optionsModel; OptionsModel* optionsModel{nullptr};
QMenu* menu; QMenu* menu{nullptr};
const PlatformStyle* m_platform_style; const PlatformStyle* m_platform_style;
/** Shows context menu with Display Unit options by the mouse coordinates */ /** Shows context menu with Display Unit options by the mouse coordinates */

View file

@ -34,8 +34,6 @@ ClientModel::ClientModel(interfaces::Node& node, OptionsModel *_optionsModel, QO
QObject(parent), QObject(parent),
m_node(node), m_node(node),
optionsModel(_optionsModel), optionsModel(_optionsModel),
peerTableModel(nullptr),
banTableModel(nullptr),
m_thread(new QThread(this)) m_thread(new QThread(this))
{ {
cachedBestHeaderHeight = -1; cachedBestHeaderHeight = -1;

View file

@ -104,9 +104,9 @@ private:
std::unique_ptr<interfaces::Handler> m_handler_notify_block_tip; std::unique_ptr<interfaces::Handler> m_handler_notify_block_tip;
std::unique_ptr<interfaces::Handler> m_handler_notify_header_tip; std::unique_ptr<interfaces::Handler> m_handler_notify_header_tip;
OptionsModel *optionsModel; OptionsModel *optionsModel;
PeerTableModel *peerTableModel; PeerTableModel* peerTableModel{nullptr};
PeerTableSortProxy* m_peer_table_sort_proxy{nullptr}; PeerTableSortProxy* m_peer_table_sort_proxy{nullptr};
BanTableModel *banTableModel; BanTableModel* banTableModel{nullptr};
//! A thread to interact with m_node asynchronously //! A thread to interact with m_node asynchronously
QThread* const m_thread; QThread* const m_thread;

View file

@ -8,9 +8,9 @@
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
CSVModelWriter::CSVModelWriter(const QString &_filename, QObject *parent) : CSVModelWriter::CSVModelWriter(const QString& _filename, QObject* parent)
QObject(parent), : QObject(parent),
filename(_filename), model(nullptr) filename(_filename)
{ {
} }

View file

@ -32,7 +32,7 @@ public:
private: private:
QString filename; QString filename;
const QAbstractItemModel *model; const QAbstractItemModel* model{nullptr};
struct Column struct Column
{ {

View file

@ -12,12 +12,10 @@
#include <QMessageBox> #include <QMessageBox>
EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) : EditAddressDialog::EditAddressDialog(Mode _mode, QWidget* parent)
QDialog(parent, GUIUtil::dialog_flags), : QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::EditAddressDialog), ui(new Ui::EditAddressDialog),
mapper(nullptr), mode(_mode)
mode(_mode),
model(nullptr)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -49,9 +49,9 @@ private:
QString getDuplicateAddressWarning() const; QString getDuplicateAddressWarning() const;
Ui::EditAddressDialog *ui; Ui::EditAddressDialog *ui;
QDataWidgetMapper *mapper; QDataWidgetMapper* mapper{nullptr};
Mode mode; Mode mode;
AddressTableModel *model; AddressTableModel* model{nullptr};
QString address; QString address;
}; };

View file

@ -122,8 +122,6 @@ int GetPruneTargetGB()
Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_size_gb) : Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_size_gb) :
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::Intro), ui(new Ui::Intro),
thread(nullptr),
signalled(false),
m_blockchain_size_gb(blockchain_size_gb), m_blockchain_size_gb(blockchain_size_gb),
m_chain_state_size_gb(chain_state_size_gb), m_chain_state_size_gb(chain_state_size_gb),
m_prune_target_gb{GetPruneTargetGB()} m_prune_target_gb{GetPruneTargetGB()}

View file

@ -64,9 +64,9 @@ private Q_SLOTS:
private: private:
Ui::Intro *ui; Ui::Intro *ui;
QThread *thread; QThread* thread{nullptr};
QMutex mutex; QMutex mutex;
bool signalled; bool signalled{false};
QString pathToCheck; QString pathToCheck;
const int64_t m_blockchain_size_gb; const int64_t m_blockchain_size_gb;
const int64_t m_chain_state_size_gb; const int64_t m_chain_state_size_gb;

View file

@ -12,13 +12,10 @@
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QResizeEvent> #include <QResizeEvent>
ModalOverlay::ModalOverlay(bool enable_wallet, QWidget *parent) : ModalOverlay::ModalOverlay(bool enable_wallet, QWidget* parent)
QWidget(parent), : QWidget(parent),
ui(new Ui::ModalOverlay), ui(new Ui::ModalOverlay),
bestHeaderHeight(0), bestHeaderDate(QDateTime())
bestHeaderDate(QDateTime()),
layerIsVisible(false),
userClosed(false)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->closeButton, &QPushButton::clicked, this, &ModalOverlay::closeClicked); connect(ui->closeButton, &QPushButton::clicked, this, &ModalOverlay::closeClicked);

View file

@ -45,11 +45,11 @@ protected:
private: private:
Ui::ModalOverlay *ui; Ui::ModalOverlay *ui;
int bestHeaderHeight; //best known height (based on the headers) int bestHeaderHeight{0}; // best known height (based on the headers)
QDateTime bestHeaderDate; QDateTime bestHeaderDate;
QVector<QPair<qint64, double> > blockProcessTime; QVector<QPair<qint64, double> > blockProcessTime;
bool layerIsVisible; bool layerIsVisible{false};
bool userClosed; bool userClosed{false};
QPropertyAnimation m_animation; QPropertyAnimation m_animation;
void UpdateHeaderSyncLabel(); void UpdateHeaderSyncLabel();
void UpdateHeaderPresyncLabel(int height, const QDateTime& blockDate); void UpdateHeaderPresyncLabel(int height, const QDateTime& blockDate);

View file

@ -32,11 +32,7 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
QObject(_parent), QObject(_parent),
parent(_parent), parent(_parent),
programName(_programName), programName(_programName),
mode(None),
trayIcon(_trayIcon) trayIcon(_trayIcon)
#ifdef USE_DBUS
,interface(nullptr)
#endif
{ {
if(_trayIcon && _trayIcon->supportsMessages()) if(_trayIcon && _trayIcon->supportsMessages())
{ {

View file

@ -61,10 +61,10 @@ private:
UserNotificationCenter /**< Use the 10.8+ User Notification Center (Mac only) */ UserNotificationCenter /**< Use the 10.8+ User Notification Center (Mac only) */
}; };
QString programName; QString programName;
Mode mode; Mode mode{None};
QSystemTrayIcon *trayIcon; QSystemTrayIcon *trayIcon;
#ifdef USE_DBUS #ifdef USE_DBUS
QDBusInterface *interface; QDBusInterface* interface{nullptr};
void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout); void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
#endif #endif

View file

@ -31,11 +31,9 @@
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QTimer> #include <QTimer>
OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
QDialog(parent, GUIUtil::dialog_flags), : QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::OptionsDialog), ui(new Ui::OptionsDialog)
model(nullptr),
mapper(nullptr)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -75,8 +75,8 @@ Q_SIGNALS:
private: private:
Ui::OptionsDialog *ui; Ui::OptionsDialog *ui;
ClientModel* m_client_model{nullptr}; ClientModel* m_client_model{nullptr};
OptionsModel *model; OptionsModel* model{nullptr};
QDataWidgetMapper *mapper; QDataWidgetMapper* mapper{nullptr};
}; };
#endif // BITCOIN_QT_OPTIONSDIALOG_H #endif // BITCOIN_QT_OPTIONSDIALOG_H

View file

@ -140,8 +140,6 @@ private:
OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) : OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::OverviewPage), ui(new Ui::OverviewPage),
clientModel(nullptr),
walletModel(nullptr),
m_platform_style{platformStyle}, m_platform_style{platformStyle},
txdelegate(new TxViewDelegate(platformStyle, this)) txdelegate(new TxViewDelegate(platformStyle, this))
{ {

View file

@ -50,8 +50,8 @@ protected:
private: private:
Ui::OverviewPage *ui; Ui::OverviewPage *ui;
ClientModel *clientModel; ClientModel* clientModel{nullptr};
WalletModel *walletModel; WalletModel* walletModel{nullptr};
bool m_privacy{false}; bool m_privacy{false};
const PlatformStyle* m_platform_style; const PlatformStyle* m_platform_style;

View file

@ -126,11 +126,8 @@ bool PaymentServer::ipcSendCommandLine()
return fResult; return fResult;
} }
PaymentServer::PaymentServer(QObject* parent, bool startLocalServer) : PaymentServer::PaymentServer(QObject* parent, bool startLocalServer)
QObject(parent), : QObject(parent)
saveURIs(true),
uriServer(nullptr),
optionsModel(nullptr)
{ {
// Install global event filter to catch QFileOpenEvents // Install global event filter to catch QFileOpenEvents
// on Mac: sent when you click bitcoin: links // on Mac: sent when you click bitcoin: links

View file

@ -101,9 +101,9 @@ protected:
bool eventFilter(QObject *object, QEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override;
private: private:
bool saveURIs; // true during startup bool saveURIs{true}; // true during startup
QLocalServer* uriServer; QLocalServer* uriServer{nullptr};
OptionsModel *optionsModel; OptionsModel* optionsModel{nullptr};
}; };
#endif // BITCOIN_QT_PAYMENTSERVER_H #endif // BITCOIN_QT_PAYMENTSERVER_H

View file

@ -14,10 +14,9 @@
#include <QList> #include <QList>
#include <QTimer> #include <QTimer>
PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent) : PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent)
QAbstractTableModel(parent), : QAbstractTableModel(parent),
m_node(node), m_node(node)
timer(nullptr)
{ {
// set up timer for auto refresh // set up timer for auto refresh
timer = new QTimer(this); timer = new QTimer(this);

View file

@ -110,7 +110,7 @@ private:
/*: Title of Peers Table column which contains the peer's /*: Title of Peers Table column which contains the peer's
User Agent string. */ User Agent string. */
tr("User Agent")}; tr("User Agent")};
QTimer *timer; QTimer* timer{nullptr};
}; };
#endif // BITCOIN_QT_PEERTABLEMODEL_H #endif // BITCOIN_QT_PEERTABLEMODEL_H

View file

@ -23,8 +23,8 @@
#include <qrencode.h> #include <qrencode.h>
#endif #endif
QRImageWidget::QRImageWidget(QWidget *parent): QRImageWidget::QRImageWidget(QWidget* parent)
QLabel(parent), contextMenu(nullptr) : QLabel(parent)
{ {
contextMenu = new QMenu(this); contextMenu = new QMenu(this);
contextMenu->addAction(tr("&Save Image…"), this, &QRImageWidget::saveImage); contextMenu->addAction(tr("&Save Image…"), this, &QRImageWidget::saveImage);

View file

@ -41,7 +41,7 @@ protected:
virtual void contextMenuEvent(QContextMenuEvent *event) override; virtual void contextMenuEvent(QContextMenuEvent *event) override;
private: private:
QMenu *contextMenu; QMenu* contextMenu{nullptr};
}; };
#endif // BITCOIN_QT_QRIMAGEWIDGET_H #endif // BITCOIN_QT_QRIMAGEWIDGET_H

View file

@ -7,10 +7,8 @@
#include <qt/bitcoinaddressvalidator.h> #include <qt/bitcoinaddressvalidator.h>
#include <qt/guiconstants.h> #include <qt/guiconstants.h>
QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) : QValidatedLineEdit::QValidatedLineEdit(QWidget* parent)
QLineEdit(parent), : QLineEdit(parent)
valid(true),
checkValidator(nullptr)
{ {
connect(this, &QValidatedLineEdit::textChanged, this, &QValidatedLineEdit::markValid); connect(this, &QValidatedLineEdit::textChanged, this, &QValidatedLineEdit::markValid);
} }

View file

@ -25,8 +25,8 @@ protected:
void focusOutEvent(QFocusEvent *evt) override; void focusOutEvent(QFocusEvent *evt) override;
private: private:
bool valid; bool valid{true};
const QValidator *checkValidator; const QValidator* checkValidator{nullptr};
public Q_SLOTS: public Q_SLOTS:
void setText(const QString&); void setText(const QString&);

View file

@ -4,8 +4,8 @@
#include <qt/qvaluecombobox.h> #include <qt/qvaluecombobox.h>
QValueComboBox::QValueComboBox(QWidget *parent) : QValueComboBox::QValueComboBox(QWidget* parent)
QComboBox(parent), role(Qt::UserRole) : QComboBox(parent)
{ {
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &QValueComboBox::handleSelectionChanged); connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &QValueComboBox::handleSelectionChanged);
} }

View file

@ -28,7 +28,7 @@ Q_SIGNALS:
void valueChanged(); void valueChanged();
private: private:
int role; int role{Qt::UserRole};
private Q_SLOTS: private Q_SLOTS:
void handleSelectionChanged(int idx); void handleSelectionChanged(int idx);

View file

@ -25,7 +25,6 @@
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) : ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveCoinsDialog), ui(new Ui::ReceiveCoinsDialog),
model(nullptr),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -51,7 +51,7 @@ public Q_SLOTS:
private: private:
Ui::ReceiveCoinsDialog *ui; Ui::ReceiveCoinsDialog *ui;
WalletModel *model; WalletModel* model{nullptr};
QMenu *contextMenu; QMenu *contextMenu;
QAction* copyLabelAction; QAction* copyLabelAction;
QAction* copyMessageAction; QAction* copyMessageAction;

View file

@ -18,10 +18,9 @@
#include <config/bitcoin-config.h> /* for USE_QRCODE */ #include <config/bitcoin-config.h> /* for USE_QRCODE */
#endif #endif
ReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) : ReceiveRequestDialog::ReceiveRequestDialog(QWidget* parent)
QDialog(parent, GUIUtil::dialog_flags), : QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveRequestDialog), ui(new Ui::ReceiveRequestDialog)
model(nullptr)
{ {
ui->setupUi(this); ui->setupUi(this);
GUIUtil::handleCloseWindowShortcut(this); GUIUtil::handleCloseWindowShortcut(this);

View file

@ -33,7 +33,7 @@ private Q_SLOTS:
private: private:
Ui::ReceiveRequestDialog *ui; Ui::ReceiveRequestDialog *ui;
WalletModel *model; WalletModel* model{nullptr};
SendCoinsRecipient info; SendCoinsRecipient info;
}; };

View file

@ -18,11 +18,11 @@ class WalletModel;
class RecentRequestEntry class RecentRequestEntry
{ {
public: public:
RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) { } RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION) {}
static const int CURRENT_VERSION = 1; static const int CURRENT_VERSION = 1;
int nVersion; int nVersion;
int64_t id; int64_t id{0};
QDateTime date; QDateTime date;
SendCoinsRecipient recipient; SendCoinsRecipient recipient;

View file

@ -64,11 +64,7 @@ int getIndexForConfTarget(int target) {
SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) : SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SendCoinsDialog), ui(new Ui::SendCoinsDialog),
clientModel(nullptr),
model(nullptr),
m_coin_control(new CCoinControl), m_coin_control(new CCoinControl),
fNewRecipientAllowed(true),
fFeeMinimized(true),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -62,12 +62,12 @@ Q_SIGNALS:
private: private:
Ui::SendCoinsDialog *ui; Ui::SendCoinsDialog *ui;
ClientModel *clientModel; ClientModel* clientModel{nullptr};
WalletModel *model; WalletModel* model{nullptr};
std::unique_ptr<wallet::CCoinControl> m_coin_control; std::unique_ptr<wallet::CCoinControl> m_coin_control;
std::unique_ptr<WalletModelTransaction> m_current_transaction; std::unique_ptr<WalletModelTransaction> m_current_transaction;
bool fNewRecipientAllowed; bool fNewRecipientAllowed{true};
bool fFeeMinimized; bool fFeeMinimized{true};
const PlatformStyle *platformStyle; const PlatformStyle *platformStyle;
// Copy PSBT to clipboard and offer to save it. // Copy PSBT to clipboard and offer to save it.

View file

@ -22,7 +22,6 @@
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) : SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SendCoinsEntry), ui(new Ui::SendCoinsEntry),
model(nullptr),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -73,7 +73,7 @@ protected:
private: private:
SendCoinsRecipient recipient; SendCoinsRecipient recipient;
Ui::SendCoinsEntry *ui; Ui::SendCoinsEntry *ui;
WalletModel *model; WalletModel* model{nullptr};
const PlatformStyle *platformStyle; const PlatformStyle *platformStyle;
bool updateLabel(const QString &address); bool updateLabel(const QString &address);

View file

@ -21,7 +21,6 @@
SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformStyle, QWidget *parent) : SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags), QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SignVerifyMessageDialog), ui(new Ui::SignVerifyMessageDialog),
model(nullptr),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {
ui->setupUi(this); ui->setupUi(this);

View file

@ -35,7 +35,7 @@ protected:
private: private:
Ui::SignVerifyMessageDialog *ui; Ui::SignVerifyMessageDialog *ui;
WalletModel *model; WalletModel* model{nullptr};
const PlatformStyle *platformStyle; const PlatformStyle *platformStyle;
private Q_SLOTS: private Q_SLOTS:

View file

@ -28,7 +28,7 @@
SplashScreen::SplashScreen(const NetworkStyle* networkStyle) SplashScreen::SplashScreen(const NetworkStyle* networkStyle)
: QWidget(), curAlignment(0) : QWidget()
{ {
// set reference point, paddings // set reference point, paddings
int paddingRight = 50; int paddingRight = 50;

View file

@ -60,7 +60,7 @@ private:
QPixmap pixmap; QPixmap pixmap;
QString curMessage; QString curMessage;
QColor curColor; QColor curColor;
int curAlignment; int curAlignment{0};
interfaces::Node* m_node = nullptr; interfaces::Node* m_node = nullptr;
bool m_shutdown = false; bool m_shutdown = false;

View file

@ -19,15 +19,10 @@
#define XMARGIN 10 #define XMARGIN 10
#define YMARGIN 10 #define YMARGIN 10
TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) : TrafficGraphWidget::TrafficGraphWidget(QWidget* parent)
QWidget(parent), : QWidget(parent),
timer(nullptr),
fMax(0.0f),
vSamplesIn(), vSamplesIn(),
vSamplesOut(), vSamplesOut()
nLastBytesIn(0),
nLastBytesOut(0),
clientModel(nullptr)
{ {
timer = new QTimer(this); timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates); connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates);

View file

@ -37,14 +37,14 @@ public Q_SLOTS:
private: private:
void paintPath(QPainterPath &path, QQueue<float> &samples); void paintPath(QPainterPath &path, QQueue<float> &samples);
QTimer *timer; QTimer* timer{nullptr};
float fMax; float fMax{0.0f};
std::chrono::minutes m_range{0}; std::chrono::minutes m_range{0};
QQueue<float> vSamplesIn; QQueue<float> vSamplesIn;
QQueue<float> vSamplesOut; QQueue<float> vSamplesOut;
quint64 nLastBytesIn; quint64 nLastBytesIn{0};
quint64 nLastBytesOut; quint64 nLastBytesOut{0};
ClientModel *clientModel; ClientModel* clientModel{nullptr};
}; };
#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H #endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H

View file

@ -11,14 +11,10 @@
#include <cstdlib> #include <cstdlib>
#include <optional> #include <optional>
TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : TransactionFilterProxy::TransactionFilterProxy(QObject* parent)
QSortFilterProxyModel(parent), : QSortFilterProxyModel(parent),
m_search_string(), m_search_string(),
typeFilter(ALL_TYPES), typeFilter(ALL_TYPES)
watchOnlyFilter(WatchOnlyFilter_All),
minAmount(0),
limitRows(-1),
showInactive(true)
{ {
} }

View file

@ -58,10 +58,10 @@ private:
std::optional<QDateTime> dateTo; std::optional<QDateTime> dateTo;
QString m_search_string; QString m_search_string;
quint32 typeFilter; quint32 typeFilter;
WatchOnlyFilter watchOnlyFilter; WatchOnlyFilter watchOnlyFilter{WatchOnlyFilter_All};
CAmount minAmount; CAmount minAmount{0};
int limitRows; int limitRows{-1};
bool showInactive; bool showInactive{true};
}; };
#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H #endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H

View file

@ -253,7 +253,6 @@ TransactionTableModel::TransactionTableModel(const PlatformStyle *_platformStyle
QAbstractTableModel(parent), QAbstractTableModel(parent),
walletModel(parent), walletModel(parent),
priv(new TransactionTablePriv(this)), priv(new TransactionTablePriv(this)),
fProcessingQueuedTransactions(false),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {
subscribeToCoreSignals(); subscribeToCoreSignals();

View file

@ -89,7 +89,7 @@ private:
std::unique_ptr<interfaces::Handler> m_handler_show_progress; std::unique_ptr<interfaces::Handler> m_handler_show_progress;
QStringList columns; QStringList columns;
TransactionTablePriv *priv; TransactionTablePriv *priv;
bool fProcessingQueuedTransactions; bool fProcessingQueuedTransactions{false};
const PlatformStyle *platformStyle; const PlatformStyle *platformStyle;
void subscribeToCoreSignals(); void subscribeToCoreSignals();

View file

@ -46,10 +46,6 @@ WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel
m_client_model(&client_model), m_client_model(&client_model),
m_node(client_model.node()), m_node(client_model.node()),
optionsModel(client_model.getOptionsModel()), optionsModel(client_model.getOptionsModel()),
addressTableModel(nullptr),
transactionTableModel(nullptr),
recentRequestsTableModel(nullptr),
cachedEncryptionStatus(Unencrypted),
timer(new QTimer(this)) timer(new QTimer(this))
{ {
fHaveWatchOnly = m_wallet->haveWatchOnly(); fHaveWatchOnly = m_wallet->haveWatchOnly();

View file

@ -181,13 +181,13 @@ private:
// (transaction fee, for example) // (transaction fee, for example)
OptionsModel *optionsModel; OptionsModel *optionsModel;
AddressTableModel *addressTableModel; AddressTableModel* addressTableModel{nullptr};
TransactionTableModel *transactionTableModel; TransactionTableModel* transactionTableModel{nullptr};
RecentRequestsTableModel *recentRequestsTableModel; RecentRequestsTableModel* recentRequestsTableModel{nullptr};
// Cache some values to be able to detect changes // Cache some values to be able to detect changes
interfaces::WalletBalances m_cached_balances; interfaces::WalletBalances m_cached_balances;
EncryptionStatus cachedEncryptionStatus; EncryptionStatus cachedEncryptionStatus{Unencrypted};
QTimer* timer; QTimer* timer;
// Block hash denoting when the last balance update was done. // Block hash denoting when the last balance update was done.

View file

@ -10,9 +10,8 @@
#include <policy/policy.h> #include <policy/policy.h>
WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &_recipients) : WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient>& _recipients)
recipients(_recipients), : recipients(_recipients)
fee(0)
{ {
} }

View file

@ -41,7 +41,7 @@ public:
private: private:
QList<SendCoinsRecipient> recipients; QList<SendCoinsRecipient> recipients;
CTransactionRef wtx; CTransactionRef wtx;
CAmount fee; CAmount fee{0};
}; };
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H #endif // BITCOIN_QT_WALLETMODELTRANSACTION_H

View file

@ -31,7 +31,6 @@
WalletView::WalletView(WalletModel* wallet_model, const PlatformStyle* _platformStyle, QWidget* parent) WalletView::WalletView(WalletModel* wallet_model, const PlatformStyle* _platformStyle, QWidget* parent)
: QStackedWidget(parent), : QStackedWidget(parent),
clientModel(nullptr),
walletModel(wallet_model), walletModel(wallet_model),
platformStyle(_platformStyle) platformStyle(_platformStyle)
{ {

View file

@ -50,7 +50,7 @@ public:
void showOutOfSyncWarning(bool fShow); void showOutOfSyncWarning(bool fShow);
private: private:
ClientModel *clientModel; ClientModel* clientModel{nullptr};
//! //!
//! The wallet model represents a bitcoin wallet, and offers access to //! The wallet model represents a bitcoin wallet, and offers access to