diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -73,7 +73,7 @@ bool setCurrentWallet(const QString &name); void removeAllWallets(); #endif // ENABLE_WALLET - bool enableWallet; + bool enableWallet = false; protected: void changeEvent(QEvent *e) override; @@ -84,51 +84,51 @@ bool eventFilter(QObject *object, QEvent *event) override; private: - ClientModel *clientModel; - WalletFrame *walletFrame; - - UnitDisplayStatusBarControl *unitDisplayControl; - QLabel *labelWalletEncryptionIcon; - QLabel *labelWalletHDStatusIcon; - QLabel *connectionsControl; - QLabel *labelBlocksIcon; - QLabel *progressBarLabel; - QProgressBar *progressBar; - QProgressDialog *progressDialog; - - QMenuBar *appMenuBar; - QAction *overviewAction; - QAction *historyAction; - QAction *quitAction; - QAction *sendCoinsAction; - QAction *sendCoinsMenuAction; - QAction *usedSendingAddressesAction; - QAction *usedReceivingAddressesAction; - QAction *signMessageAction; - QAction *verifyMessageAction; - QAction *aboutAction; - QAction *receiveCoinsAction; - QAction *receiveCoinsMenuAction; - QAction *optionsAction; - QAction *toggleHideAction; - QAction *encryptWalletAction; - QAction *backupWalletAction; - QAction *changePassphraseAction; - QAction *aboutQtAction; - QAction *openRPCConsoleAction; - QAction *openAction; - QAction *showHelpMessageAction; - - QSystemTrayIcon *trayIcon; - QMenu *trayIconMenu; - Notificator *notificator; - RPCConsole *rpcConsole; - HelpMessageDialog *helpMessageDialog; - ModalOverlay *modalOverlay; + ClientModel *clientModel = nullptr; + WalletFrame *walletFrame = nullptr; + + UnitDisplayStatusBarControl *unitDisplayControl = nullptr; + QLabel *labelWalletEncryptionIcon = nullptr; + QLabel *labelWalletHDStatusIcon = nullptr; + QLabel *connectionsControl = nullptr; + QLabel *labelBlocksIcon = nullptr; + QLabel *progressBarLabel = nullptr; + QProgressBar *progressBar = nullptr; + QProgressDialog *progressDialog = nullptr; + + QMenuBar *appMenuBar = nullptr; + QAction *overviewAction = nullptr; + QAction *historyAction = nullptr; + QAction *quitAction = nullptr; + QAction *sendCoinsAction = nullptr; + QAction *sendCoinsMenuAction = nullptr; + QAction *usedSendingAddressesAction = nullptr; + QAction *usedReceivingAddressesAction = nullptr; + QAction *signMessageAction = nullptr; + QAction *verifyMessageAction = nullptr; + QAction *aboutAction = nullptr; + QAction *receiveCoinsAction = nullptr; + QAction *receiveCoinsMenuAction = nullptr; + QAction *optionsAction = nullptr; + QAction *toggleHideAction = nullptr; + QAction *encryptWalletAction = nullptr; + QAction *backupWalletAction = nullptr; + QAction *changePassphraseAction = nullptr; + QAction *aboutQtAction = nullptr; + QAction *openRPCConsoleAction = nullptr; + QAction *openAction = nullptr; + QAction *showHelpMessageAction = nullptr; + + QSystemTrayIcon *trayIcon = nullptr; + QMenu *trayIconMenu = nullptr; + Notificator *notificator = nullptr; + RPCConsole *rpcConsole = nullptr; + HelpMessageDialog *helpMessageDialog = nullptr; + ModalOverlay *modalOverlay = nullptr; /** Keep track of previous number of blocks, to detect progress */ - int prevBlocks; - int spinnerFrame; + int prevBlocks = 0; + int spinnerFrame = 0; const PlatformStyle *platformStyle; const Config *config; diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -77,20 +77,8 @@ BitcoinGUI::BitcoinGUI(const Config *configIn, const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) - : QMainWindow(parent), enableWallet(false), clientModel(0), walletFrame(0), - unitDisplayControl(0), labelWalletEncryptionIcon(0), - labelWalletHDStatusIcon(0), connectionsControl(0), labelBlocksIcon(0), - progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), - overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), - sendCoinsMenuAction(0), usedSendingAddressesAction(0), - usedReceivingAddressesAction(0), signMessageAction(0), - verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), - receiveCoinsMenuAction(0), optionsAction(0), toggleHideAction(0), - encryptWalletAction(0), backupWalletAction(0), changePassphraseAction(0), - aboutQtAction(0), openRPCConsoleAction(0), openAction(0), - showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), - rpcConsole(0), helpMessageDialog(0), modalOverlay(0), prevBlocks(0), - spinnerFrame(0), platformStyle(_platformStyle), config(configIn) { + : QMainWindow(parent), enableWallet(false), platformStyle(_platformStyle), + config(configIn) { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); QString windowTitle = tr(PACKAGE_NAME) + " - ";