From bc21aed5af96e1f86cd6cfd78c377fc0941066c5 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 27 Jun 2021 14:13:05 +0200 Subject: [PATCH] UI: use QScopedPointer --- src/calcwidget.cpp | 4 +--- src/calcwidget.h | 2 +- src/calcwindow.cpp | 4 +--- src/calcwindow.h | 2 +- src/coinswidget.cpp | 4 +--- src/coinswidget.h | 2 +- src/contactswidget.cpp | 5 +---- src/contactswidget.h | 2 +- src/dialog/AboutDialog.cpp | 4 +--- src/dialog/AboutDialog.h | 2 +- src/dialog/AccountSwitcherDialog.cpp | 4 +--- src/dialog/AccountSwitcherDialog.h | 2 +- src/dialog/BalanceDialog.cpp | 4 +--- src/dialog/BalanceDialog.h | 2 +- src/dialog/BroadcastTxDialog.cpp | 4 +--- src/dialog/BroadcastTxDialog.h | 2 +- src/dialog/CalcConfigDialog.cpp | 4 +--- src/dialog/CalcConfigDialog.h | 2 +- src/dialog/ContactsDialog.cpp | 5 +---- src/dialog/ContactsDialog.h | 2 +- src/dialog/DebugInfoDialog.cpp | 4 +--- src/dialog/DebugInfoDialog.h | 2 +- src/dialog/InfoDialog.cpp | 4 +--- src/dialog/InfoDialog.h | 2 +- src/dialog/KeysDialog.cpp | 5 +---- src/dialog/KeysDialog.h | 2 +- src/dialog/LocalMoneroInfoDialog.cpp | 4 +--- src/dialog/LocalMoneroInfoDialog.h | 2 +- src/dialog/OutputInfoDialog.cpp | 4 +--- src/dialog/OutputInfoDialog.h | 2 +- src/dialog/OutputSweepDialog.cpp | 9 +++------ src/dialog/OutputSweepDialog.h | 2 +- src/dialog/PasswordChangeDialog.cpp | 5 +---- src/dialog/PasswordChangeDialog.h | 2 +- src/dialog/PasswordDialog.cpp | 5 +---- src/dialog/PasswordDialog.h | 2 +- src/dialog/QrCodeDialog.cpp | 5 +---- src/dialog/QrCodeDialog.h | 2 +- src/dialog/SeedDialog.cpp | 5 +---- src/dialog/SeedDialog.h | 2 +- src/dialog/SignVerifyDialog.cpp | 5 +---- src/dialog/SignVerifyDialog.h | 2 +- src/dialog/SplashDialog.cpp | 4 +--- src/dialog/SplashDialog.h | 2 +- src/dialog/TorInfoDialog.cpp | 4 +--- src/dialog/TorInfoDialog.h | 2 +- src/dialog/TransactionInfoDialog.cpp | 4 +--- src/dialog/TransactionInfoDialog.h | 2 +- src/dialog/TxConfAdvDialog.cpp | 4 +--- src/dialog/TxConfAdvDialog.h | 2 +- src/dialog/TxConfDialog.cpp | 4 +--- src/dialog/TxConfDialog.h | 2 +- src/dialog/TxImportDialog.cpp | 4 +--- src/dialog/TxImportDialog.h | 2 +- src/dialog/TxProofDialog.cpp | 4 +--- src/dialog/TxProofDialog.h | 2 +- src/dialog/UpdateDialog.cpp | 4 +--- src/dialog/UpdateDialog.h | 2 +- src/dialog/VerifyProofDialog.cpp | 5 +---- src/dialog/VerifyProofDialog.h | 2 +- src/dialog/ViewOnlyDialog.cpp | 5 +---- src/dialog/ViewOnlyDialog.h | 2 +- src/dialog/WalletCacheDebugDialog.cpp | 5 +---- src/dialog/WalletCacheDebugDialog.h | 2 +- src/dialog/WalletInfoDialog.cpp | 4 +--- src/dialog/WalletInfoDialog.h | 2 +- src/historywidget.cpp | 4 +--- src/historywidget.h | 2 +- src/mainwindow.cpp | 4 +--- src/mainwindow.h | 2 +- src/qrcode_scanner/QrCodeScanDialog.cpp | 1 - src/qrcode_scanner/QrCodeScanDialog.h | 2 +- src/receivewidget.cpp | 4 +--- src/receivewidget.h | 2 +- src/sendwidget.cpp | 4 +--- src/sendwidget.h | 2 +- src/settings.cpp | 4 +--- src/settings.h | 2 +- src/widgets/LocalMoneroWidget.cpp | 8 +++----- src/widgets/LocalMoneroWidget.h | 2 +- src/widgets/RestoreHeightWidget.cpp | 4 +--- src/widgets/RestoreHeightWidget.h | 2 +- src/widgets/TickerWidget.cpp | 4 +--- src/widgets/TickerWidget.h | 2 +- src/widgets/ccswidget.cpp | 4 +--- src/widgets/ccswidget.h | 2 +- src/widgets/nodewidget.cpp | 4 +--- src/widgets/nodewidget.h | 2 +- src/widgets/redditwidget.cpp | 4 +--- src/widgets/redditwidget.h | 2 +- src/widgets/xmrigwidget.cpp | 4 +--- src/widgets/xmrigwidget.h | 2 +- 92 files changed, 95 insertions(+), 198 deletions(-) diff --git a/src/calcwidget.cpp b/src/calcwidget.cpp index 11616a2..626dac0 100644 --- a/src/calcwidget.cpp +++ b/src/calcwidget.cpp @@ -144,6 +144,4 @@ void CalcWidget::setupComboBox(QComboBox *comboBox, const QStringList &crypto, c comboBox->addItems(fiat); } -CalcWidget::~CalcWidget() { - delete ui; -} +CalcWidget::~CalcWidget() = default; \ No newline at end of file diff --git a/src/calcwidget.h b/src/calcwidget.h index f5c4af1..b4fb58a 100644 --- a/src/calcwidget.h +++ b/src/calcwidget.h @@ -31,7 +31,7 @@ private: void convert(bool reverse); void setupComboBox(QComboBox *comboBox, const QStringList &crypto, const QStringList &fiat); - Ui::CalcWidget *ui; + QScopedPointer ui; bool m_comboBoxInit = false; }; diff --git a/src/calcwindow.cpp b/src/calcwindow.cpp index 1b72fc3..77a9260 100644 --- a/src/calcwindow.cpp +++ b/src/calcwindow.cpp @@ -23,6 +23,4 @@ void CalcWindow::closeEvent(QCloseEvent *foo) { emit closed(); } -CalcWindow::~CalcWindow() { - delete ui; -} +CalcWindow::~CalcWindow() = default; \ No newline at end of file diff --git a/src/calcwindow.h b/src/calcwindow.h index 886a9fb..854fdfb 100644 --- a/src/calcwindow.h +++ b/src/calcwindow.h @@ -25,7 +25,7 @@ private: void closeEvent(QCloseEvent *bar) override; private: - Ui::CalcWindow *ui; + QScopedPointer ui; }; #endif // CalcWindow_H diff --git a/src/coinswidget.cpp b/src/coinswidget.cpp index 8c83acf..55c9441 100644 --- a/src/coinswidget.cpp +++ b/src/coinswidget.cpp @@ -243,6 +243,4 @@ void CoinsWidget::thawCoins(const QVector &indexes) { m_ctx->updateBalance(); } -CoinsWidget::~CoinsWidget() { - delete ui; -} +CoinsWidget::~CoinsWidget() = default; \ No newline at end of file diff --git a/src/coinswidget.h b/src/coinswidget.h index 91ffba9..2be9650 100644 --- a/src/coinswidget.h +++ b/src/coinswidget.h @@ -50,7 +50,7 @@ private: Amount }; - Ui::CoinsWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; QMenu *m_contextMenu; diff --git a/src/contactswidget.cpp b/src/contactswidget.cpp index 679f8cc..6075bb4 100644 --- a/src/contactswidget.cpp +++ b/src/contactswidget.cpp @@ -150,7 +150,4 @@ void ContactsWidget::deleteContact() m_model->deleteRow(m_proxyModel->mapToSource(index).row()); } -ContactsWidget::~ContactsWidget() -{ - delete ui; -} +ContactsWidget::~ContactsWidget() = default; diff --git a/src/contactswidget.h b/src/contactswidget.h index 5c2a819..bf2807b 100644 --- a/src/contactswidget.h +++ b/src/contactswidget.h @@ -42,7 +42,7 @@ private slots: void showHeaderMenu(const QPoint &position); private: - Ui::ContactsWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; QAction *m_showFullAddressesAction; diff --git a/src/dialog/AboutDialog.cpp b/src/dialog/AboutDialog.cpp index 781bdb0..93afb71 100644 --- a/src/dialog/AboutDialog.cpp +++ b/src/dialog/AboutDialog.cpp @@ -38,7 +38,5 @@ AboutDialog::AboutDialog(QWidget *parent) this->adjustSize(); } -AboutDialog::~AboutDialog() { - delete ui; -} +AboutDialog::~AboutDialog() = default; diff --git a/src/dialog/AboutDialog.h b/src/dialog/AboutDialog.h index 5f08290..54efa9d 100644 --- a/src/dialog/AboutDialog.h +++ b/src/dialog/AboutDialog.h @@ -21,7 +21,7 @@ public: ~AboutDialog() override; private: - Ui::AboutDialog *ui; + QScopedPointer ui; QStringListModel *m_model; }; diff --git a/src/dialog/AccountSwitcherDialog.cpp b/src/dialog/AccountSwitcherDialog.cpp index 5041657..d52334b 100644 --- a/src/dialog/AccountSwitcherDialog.cpp +++ b/src/dialog/AccountSwitcherDialog.cpp @@ -103,6 +103,4 @@ Monero::SubaddressAccountRow* AccountSwitcherDialog::currentEntry() { return m_ctx->wallet->subaddressAccountModel()->entryFromIndex(index); } -AccountSwitcherDialog::~AccountSwitcherDialog() { - delete ui; -} +AccountSwitcherDialog::~AccountSwitcherDialog() = default; diff --git a/src/dialog/AccountSwitcherDialog.h b/src/dialog/AccountSwitcherDialog.h index 077b3c1..ac69ed3 100644 --- a/src/dialog/AccountSwitcherDialog.h +++ b/src/dialog/AccountSwitcherDialog.h @@ -33,7 +33,7 @@ private: Monero::SubaddressAccountRow* currentEntry(); - Ui::AccountSwitcherDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; SubaddressAccountModel *m_model; SubaddressAccountProxyModel *m_proxyModel; diff --git a/src/dialog/BalanceDialog.cpp b/src/dialog/BalanceDialog.cpp index 64af6d5..1d196c3 100644 --- a/src/dialog/BalanceDialog.cpp +++ b/src/dialog/BalanceDialog.cpp @@ -22,6 +22,4 @@ BalanceDialog::BalanceDialog(QWidget *parent, Wallet *wallet) this->adjustSize(); } -BalanceDialog::~BalanceDialog() { - delete ui; -} +BalanceDialog::~BalanceDialog() = default; diff --git a/src/dialog/BalanceDialog.h b/src/dialog/BalanceDialog.h index 3812be0..d6ae26b 100644 --- a/src/dialog/BalanceDialog.h +++ b/src/dialog/BalanceDialog.h @@ -21,7 +21,7 @@ public: ~BalanceDialog() override; private: - Ui::BalanceDialog *ui; + QScopedPointer ui; }; #endif //FEATHER_BALANCEDIALOG_H diff --git a/src/dialog/BroadcastTxDialog.cpp b/src/dialog/BroadcastTxDialog.cpp index c18f0ab..5f031d5 100644 --- a/src/dialog/BroadcastTxDialog.cpp +++ b/src/dialog/BroadcastTxDialog.cpp @@ -56,6 +56,4 @@ void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { } } -BroadcastTxDialog::~BroadcastTxDialog() { - delete ui; -} +BroadcastTxDialog::~BroadcastTxDialog() = default; diff --git a/src/dialog/BroadcastTxDialog.h b/src/dialog/BroadcastTxDialog.h index 0f32c7d..eefc93f 100644 --- a/src/dialog/BroadcastTxDialog.h +++ b/src/dialog/BroadcastTxDialog.h @@ -25,7 +25,7 @@ private slots: void onApiResponse(const DaemonRpc::DaemonResponse &resp); private: - Ui::BroadcastTxDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; UtilsNetworking *m_network; DaemonRpc *m_rpc; diff --git a/src/dialog/CalcConfigDialog.cpp b/src/dialog/CalcConfigDialog.cpp index 319d376..8398ae1 100644 --- a/src/dialog/CalcConfigDialog.cpp +++ b/src/dialog/CalcConfigDialog.cpp @@ -97,6 +97,4 @@ void CalcConfigDialog::fillListWidgets() { setChecked(ui->list_fiat, checkedFiatCurrencies); } -CalcConfigDialog::~CalcConfigDialog() { - delete ui; -} +CalcConfigDialog::~CalcConfigDialog() = default; \ No newline at end of file diff --git a/src/dialog/CalcConfigDialog.h b/src/dialog/CalcConfigDialog.h index aceed43..37f7a2d 100644 --- a/src/dialog/CalcConfigDialog.h +++ b/src/dialog/CalcConfigDialog.h @@ -32,7 +32,7 @@ private: void fillListWidgets(); QListWidget* getVisibleListWidget(); - Ui::CalcConfigDialog *ui; + QScopedPointer ui; }; diff --git a/src/dialog/ContactsDialog.cpp b/src/dialog/ContactsDialog.cpp index 4e32db0..1471676 100644 --- a/src/dialog/ContactsDialog.cpp +++ b/src/dialog/ContactsDialog.cpp @@ -25,10 +25,7 @@ ContactsDialog::ContactsDialog(QWidget *parent, const QString &address, const QS this->adjustSize(); } -ContactsDialog::~ContactsDialog() -{ - delete ui; -} +ContactsDialog::~ContactsDialog() = default; QString ContactsDialog::getAddress() { return m_address; diff --git a/src/dialog/ContactsDialog.h b/src/dialog/ContactsDialog.h index f94bf34..03b81c4 100644 --- a/src/dialog/ContactsDialog.h +++ b/src/dialog/ContactsDialog.h @@ -22,7 +22,7 @@ public: QString getName(); private: - Ui::ContactsDialog *ui; + QScopedPointer ui; QString m_address; QString m_name; diff --git a/src/dialog/DebugInfoDialog.cpp b/src/dialog/DebugInfoDialog.cpp index 8e9b490..3258ed5 100644 --- a/src/dialog/DebugInfoDialog.cpp +++ b/src/dialog/DebugInfoDialog.cpp @@ -146,6 +146,4 @@ void DebugInfoDialog::copyToClipboad() { Utils::copyToClipboard(text); } -DebugInfoDialog::~DebugInfoDialog() { - delete ui; -} +DebugInfoDialog::~DebugInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/DebugInfoDialog.h b/src/dialog/DebugInfoDialog.h index 80a5391..73e84d5 100644 --- a/src/dialog/DebugInfoDialog.h +++ b/src/dialog/DebugInfoDialog.h @@ -25,7 +25,7 @@ private: void copyToClipboad(); void updateInfo(); - Ui::DebugInfoDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; QTimer m_updateTimer; diff --git a/src/dialog/InfoDialog.cpp b/src/dialog/InfoDialog.cpp index 9b791a9..976d96c 100644 --- a/src/dialog/InfoDialog.cpp +++ b/src/dialog/InfoDialog.cpp @@ -14,6 +14,4 @@ InfoDialog::InfoDialog(QWidget *parent, const QString &title, const QString &inf ui->info->setPlainText(infoData); } -InfoDialog::~InfoDialog() { - delete ui; -} \ No newline at end of file +InfoDialog::~InfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/InfoDialog.h b/src/dialog/InfoDialog.h index 3858156..fa18b5b 100644 --- a/src/dialog/InfoDialog.h +++ b/src/dialog/InfoDialog.h @@ -19,7 +19,7 @@ public: ~InfoDialog() override; private: - Ui::InfoDialog *ui; + QScopedPointer ui; }; diff --git a/src/dialog/KeysDialog.cpp b/src/dialog/KeysDialog.cpp index 96a499b..7fe362d 100644 --- a/src/dialog/KeysDialog.cpp +++ b/src/dialog/KeysDialog.cpp @@ -22,7 +22,4 @@ KeysDialog::KeysDialog(QSharedPointer ctx, QWidget *parent) this->adjustSize(); } -KeysDialog::~KeysDialog() -{ - delete ui; -} +KeysDialog::~KeysDialog() = default; diff --git a/src/dialog/KeysDialog.h b/src/dialog/KeysDialog.h index 84df75d..198de4f 100644 --- a/src/dialog/KeysDialog.h +++ b/src/dialog/KeysDialog.h @@ -20,7 +20,7 @@ public: ~KeysDialog() override; private: - Ui::KeysDialog *ui; + QScopedPointer ui; }; diff --git a/src/dialog/LocalMoneroInfoDialog.cpp b/src/dialog/LocalMoneroInfoDialog.cpp index 8cdfa03..f921642 100644 --- a/src/dialog/LocalMoneroInfoDialog.cpp +++ b/src/dialog/LocalMoneroInfoDialog.cpp @@ -46,6 +46,4 @@ void LocalMoneroInfoDialog::onGoToOffer() { Utils::externalLinkWarning(this, offerUrl); } -LocalMoneroInfoDialog::~LocalMoneroInfoDialog() { - delete ui; -} \ No newline at end of file +LocalMoneroInfoDialog::~LocalMoneroInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/LocalMoneroInfoDialog.h b/src/dialog/LocalMoneroInfoDialog.h index 584f87a..d7ee3ae 100644 --- a/src/dialog/LocalMoneroInfoDialog.h +++ b/src/dialog/LocalMoneroInfoDialog.h @@ -26,7 +26,7 @@ private slots: private: void setLabelText(QLabel *label, LocalMoneroModel::Column column); - Ui::LocalMoneroInfoDialog *ui; + QScopedPointer ui; LocalMoneroModel *m_model; int m_row; }; diff --git a/src/dialog/OutputInfoDialog.cpp b/src/dialog/OutputInfoDialog.cpp index 0ae203f..0f5c677 100644 --- a/src/dialog/OutputInfoDialog.cpp +++ b/src/dialog/OutputInfoDialog.cpp @@ -37,6 +37,4 @@ OutputInfoDialog::OutputInfoDialog(CoinsInfo *cInfo, QWidget *parent) this->adjustSize(); } -OutputInfoDialog::~OutputInfoDialog() { - delete ui; -} +OutputInfoDialog::~OutputInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/OutputInfoDialog.h b/src/dialog/OutputInfoDialog.h index a691ab6..bb73f35 100644 --- a/src/dialog/OutputInfoDialog.h +++ b/src/dialog/OutputInfoDialog.h @@ -21,7 +21,7 @@ public: ~OutputInfoDialog() override; private: - Ui::OutputInfoDialog *ui; + QScopedPointer ui; }; diff --git a/src/dialog/OutputSweepDialog.cpp b/src/dialog/OutputSweepDialog.cpp index 9625ab2..4674e49 100644 --- a/src/dialog/OutputSweepDialog.cpp +++ b/src/dialog/OutputSweepDialog.cpp @@ -40,11 +40,6 @@ OutputSweepDialog::OutputSweepDialog(QWidget *parent, CoinsInfo* coin) this->adjustSize(); } -OutputSweepDialog::~OutputSweepDialog() -{ - delete ui; -} - QString OutputSweepDialog::address() { return m_address; } @@ -55,4 +50,6 @@ bool OutputSweepDialog::churn() const { int OutputSweepDialog::outputs() const { return m_outputs; -} \ No newline at end of file +} + +OutputSweepDialog::~OutputSweepDialog() = default; \ No newline at end of file diff --git a/src/dialog/OutputSweepDialog.h b/src/dialog/OutputSweepDialog.h index f91e65f..017b8c7 100644 --- a/src/dialog/OutputSweepDialog.h +++ b/src/dialog/OutputSweepDialog.h @@ -24,7 +24,7 @@ public: int outputs() const; private: - Ui::OutputSweepDialog *ui; + QScopedPointer ui; uint64_t m_amount; diff --git a/src/dialog/PasswordChangeDialog.cpp b/src/dialog/PasswordChangeDialog.cpp index c0a02b5..5650f19 100644 --- a/src/dialog/PasswordChangeDialog.cpp +++ b/src/dialog/PasswordChangeDialog.cpp @@ -40,10 +40,7 @@ PasswordChangeDialog::PasswordChangeDialog(QWidget *parent, Wallet *wallet) this->adjustSize(); } -PasswordChangeDialog::~PasswordChangeDialog() -{ - delete ui; -} +PasswordChangeDialog::~PasswordChangeDialog() = default; void PasswordChangeDialog::passwordsMatch() { bool match = ui->lineEdit_newPassword->text() == ui->lineEdit_confirmPassword->text(); diff --git a/src/dialog/PasswordChangeDialog.h b/src/dialog/PasswordChangeDialog.h index 43debbb..89237b8 100644 --- a/src/dialog/PasswordChangeDialog.h +++ b/src/dialog/PasswordChangeDialog.h @@ -20,7 +20,7 @@ public: ~PasswordChangeDialog() override; private: - Ui::PasswordChangeDialog *ui; + QScopedPointer ui; Wallet *m_wallet; void passwordsMatch(); diff --git a/src/dialog/PasswordDialog.cpp b/src/dialog/PasswordDialog.cpp index bca2d3c..e23d8ad 100644 --- a/src/dialog/PasswordDialog.cpp +++ b/src/dialog/PasswordDialog.cpp @@ -22,7 +22,4 @@ PasswordDialog::PasswordDialog(const QString &walletName, bool incorrectPassword this->adjustSize(); } -PasswordDialog::~PasswordDialog() -{ - delete ui; -} +PasswordDialog::~PasswordDialog() = default; \ No newline at end of file diff --git a/src/dialog/PasswordDialog.h b/src/dialog/PasswordDialog.h index a204cea..544331f 100644 --- a/src/dialog/PasswordDialog.h +++ b/src/dialog/PasswordDialog.h @@ -21,7 +21,7 @@ public: QString password = ""; private: - Ui::PasswordDialog *ui; + QScopedPointer ui; }; #endif //FEATHER_PASSWORDDIALOG_H diff --git a/src/dialog/QrCodeDialog.cpp b/src/dialog/QrCodeDialog.cpp index 411133b..3d0fb5d 100644 --- a/src/dialog/QrCodeDialog.cpp +++ b/src/dialog/QrCodeDialog.cpp @@ -27,10 +27,7 @@ QrCodeDialog::QrCodeDialog(QWidget *parent, const QrCode &qrCode, const QString this->adjustSize(); } -QrCodeDialog::~QrCodeDialog() -{ - delete ui; -} +QrCodeDialog::~QrCodeDialog() = default; void QrCodeDialog::setQrCode(const QrCode &qrCode) { m_pixmap = qrCode.toPixmap(1).scaled(500, 500, Qt::KeepAspectRatio); diff --git a/src/dialog/QrCodeDialog.h b/src/dialog/QrCodeDialog.h index 83c9715..518a44d 100644 --- a/src/dialog/QrCodeDialog.h +++ b/src/dialog/QrCodeDialog.h @@ -24,7 +24,7 @@ private: void copyImage(); void saveImage(); - Ui::QrCodeDialog *ui; + QScopedPointer ui; QPixmap m_pixmap; }; diff --git a/src/dialog/SeedDialog.cpp b/src/dialog/SeedDialog.cpp index b2788b7..a6121dc 100644 --- a/src/dialog/SeedDialog.cpp +++ b/src/dialog/SeedDialog.cpp @@ -62,7 +62,4 @@ void SeedDialog::setSeed(const QString &seed) { "").arg(words)); } -SeedDialog::~SeedDialog() -{ - delete ui; -} \ No newline at end of file +SeedDialog::~SeedDialog() = default; \ No newline at end of file diff --git a/src/dialog/SeedDialog.h b/src/dialog/SeedDialog.h index b1e211b..4fa3038 100644 --- a/src/dialog/SeedDialog.h +++ b/src/dialog/SeedDialog.h @@ -22,7 +22,7 @@ public: private: void setSeed(const QString &seed); - Ui::SeedDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; }; diff --git a/src/dialog/SignVerifyDialog.cpp b/src/dialog/SignVerifyDialog.cpp index 49f8363..cfeeb83 100644 --- a/src/dialog/SignVerifyDialog.cpp +++ b/src/dialog/SignVerifyDialog.cpp @@ -52,7 +52,4 @@ void SignVerifyDialog::copyToClipboard() { Utils::copyToClipboard(sig.join("\n")); } -SignVerifyDialog::~SignVerifyDialog() -{ - delete ui; -} \ No newline at end of file +SignVerifyDialog::~SignVerifyDialog() = default; \ No newline at end of file diff --git a/src/dialog/SignVerifyDialog.h b/src/dialog/SignVerifyDialog.h index 0436cea..315a640 100644 --- a/src/dialog/SignVerifyDialog.h +++ b/src/dialog/SignVerifyDialog.h @@ -20,7 +20,7 @@ public: ~SignVerifyDialog() override; private: - Ui::SignVerifyDialog *ui; + QScopedPointer ui; Wallet *m_wallet; private slots: diff --git a/src/dialog/SplashDialog.cpp b/src/dialog/SplashDialog.cpp index 191ae89..db3a4c4 100644 --- a/src/dialog/SplashDialog.cpp +++ b/src/dialog/SplashDialog.cpp @@ -29,6 +29,4 @@ void SplashDialog::setIcon(const QPixmap &icon) { ui->icon->setPixmap(icon.scaledToWidth(32, Qt::SmoothTransformation)); } -SplashDialog::~SplashDialog() { - delete ui; -} +SplashDialog::~SplashDialog() = default; \ No newline at end of file diff --git a/src/dialog/SplashDialog.h b/src/dialog/SplashDialog.h index c4acf90..7341b7d 100644 --- a/src/dialog/SplashDialog.h +++ b/src/dialog/SplashDialog.h @@ -22,7 +22,7 @@ public: void setIcon(const QPixmap &icon); private: - Ui::SplashDialog *ui; + QScopedPointer ui; }; #endif //FEATHER_SPLASHDIALOG_H diff --git a/src/dialog/TorInfoDialog.cpp b/src/dialog/TorInfoDialog.cpp index 9abda78..eecf72b 100644 --- a/src/dialog/TorInfoDialog.cpp +++ b/src/dialog/TorInfoDialog.cpp @@ -165,6 +165,4 @@ void TorInfoDialog::onShowInitSyncConfigDialog() { } } -TorInfoDialog::~TorInfoDialog() { - delete ui; -} +TorInfoDialog::~TorInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/TorInfoDialog.h b/src/dialog/TorInfoDialog.h index 3b3847e..8d5788f 100644 --- a/src/dialog/TorInfoDialog.h +++ b/src/dialog/TorInfoDialog.h @@ -38,7 +38,7 @@ private: void initConnectionSettings(); void initPrivacyLevel(); - Ui::TorInfoDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; }; diff --git a/src/dialog/TransactionInfoDialog.cpp b/src/dialog/TransactionInfoDialog.cpp index 547ae96..a7dcc8d 100644 --- a/src/dialog/TransactionInfoDialog.cpp +++ b/src/dialog/TransactionInfoDialog.cpp @@ -134,6 +134,4 @@ void TransactionInfoDialog::createTxProof() { m_txProofDialog->show(); } -TransactionInfoDialog::~TransactionInfoDialog() { - delete ui; -} +TransactionInfoDialog::~TransactionInfoDialog() = default; \ No newline at end of file diff --git a/src/dialog/TransactionInfoDialog.h b/src/dialog/TransactionInfoDialog.h index 6cb2960..95f8136 100644 --- a/src/dialog/TransactionInfoDialog.h +++ b/src/dialog/TransactionInfoDialog.h @@ -31,7 +31,7 @@ private: void setData(TransactionInfo* tx); void updateData(); - Ui::TransactionInfoDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; TransactionInfo *m_txInfo; diff --git a/src/dialog/TxConfAdvDialog.cpp b/src/dialog/TxConfAdvDialog.cpp index c10665e..6aed963 100644 --- a/src/dialog/TxConfAdvDialog.cpp +++ b/src/dialog/TxConfAdvDialog.cpp @@ -184,6 +184,4 @@ void TxConfAdvDialog::closeDialog() { QDialog::reject(); } -TxConfAdvDialog::~TxConfAdvDialog() { - delete ui; -} +TxConfAdvDialog::~TxConfAdvDialog() = default; \ No newline at end of file diff --git a/src/dialog/TxConfAdvDialog.h b/src/dialog/TxConfAdvDialog.h index e59a766..0afbe84 100644 --- a/src/dialog/TxConfAdvDialog.h +++ b/src/dialog/TxConfAdvDialog.h @@ -42,7 +42,7 @@ private: void signedQrCode(); void signedSaveFile(); - Ui::TxConfAdvDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; PendingTransaction *m_tx = nullptr; UnsignedTransaction *m_utx = nullptr; diff --git a/src/dialog/TxConfDialog.cpp b/src/dialog/TxConfDialog.cpp index d7880f2..4437f7f 100644 --- a/src/dialog/TxConfDialog.cpp +++ b/src/dialog/TxConfDialog.cpp @@ -86,6 +86,4 @@ void TxConfDialog::setShowAdvanced() { QDialog::reject(); } -TxConfDialog::~TxConfDialog() { - delete ui; -} +TxConfDialog::~TxConfDialog() = default; \ No newline at end of file diff --git a/src/dialog/TxConfDialog.h b/src/dialog/TxConfDialog.h index 1057df8..ae76672 100644 --- a/src/dialog/TxConfDialog.h +++ b/src/dialog/TxConfDialog.h @@ -26,7 +26,7 @@ public: private: void setShowAdvanced(); - Ui::TxConfDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; PendingTransaction *m_tx; QString m_address; diff --git a/src/dialog/TxImportDialog.cpp b/src/dialog/TxImportDialog.cpp index 1a47a56..96967f5 100644 --- a/src/dialog/TxImportDialog.cpp +++ b/src/dialog/TxImportDialog.cpp @@ -100,6 +100,4 @@ void TxImportDialog::onImport() { m_ctx->refreshModels(); } -TxImportDialog::~TxImportDialog() { - delete ui; -} +TxImportDialog::~TxImportDialog() = default; diff --git a/src/dialog/TxImportDialog.h b/src/dialog/TxImportDialog.h index 6b6992c..d5025ee 100644 --- a/src/dialog/TxImportDialog.h +++ b/src/dialog/TxImportDialog.h @@ -26,7 +26,7 @@ private slots: void onApiResponse(const DaemonRpc::DaemonResponse &resp); private: - Ui::TxImportDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; UtilsNetworking *m_network; diff --git a/src/dialog/TxProofDialog.cpp b/src/dialog/TxProofDialog.cpp index 428a697..dae7ab3 100644 --- a/src/dialog/TxProofDialog.cpp +++ b/src/dialog/TxProofDialog.cpp @@ -226,7 +226,5 @@ TxProof TxProofDialog::getProof() { return proof; } -TxProofDialog::~TxProofDialog() { - delete ui; -} +TxProofDialog::~TxProofDialog() = default; diff --git a/src/dialog/TxProofDialog.h b/src/dialog/TxProofDialog.h index d010248..5bb7250 100644 --- a/src/dialog/TxProofDialog.h +++ b/src/dialog/TxProofDialog.h @@ -49,7 +49,7 @@ private: Mode m_mode; TransactionInfo::Direction m_direction; - Ui::TxProofDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; }; diff --git a/src/dialog/UpdateDialog.cpp b/src/dialog/UpdateDialog.cpp index f548370..f6947e1 100644 --- a/src/dialog/UpdateDialog.cpp +++ b/src/dialog/UpdateDialog.cpp @@ -223,6 +223,4 @@ void UpdateDialog::setStatus(const QString &msg, bool success) { ui->label_body->setStyleSheet(""); } -UpdateDialog::~UpdateDialog() { - delete ui; -} +UpdateDialog::~UpdateDialog() = default; \ No newline at end of file diff --git a/src/dialog/UpdateDialog.h b/src/dialog/UpdateDialog.h index 86d959a..2739666 100644 --- a/src/dialog/UpdateDialog.h +++ b/src/dialog/UpdateDialog.h @@ -34,7 +34,7 @@ signals: private: void setStatus(const QString &msg, bool success = false); - Ui::UpdateDialog *ui; + QScopedPointer ui; QString m_version; QString m_downloadUrl; diff --git a/src/dialog/VerifyProofDialog.cpp b/src/dialog/VerifyProofDialog.cpp index ff7238e..3c09e24 100644 --- a/src/dialog/VerifyProofDialog.cpp +++ b/src/dialog/VerifyProofDialog.cpp @@ -53,10 +53,7 @@ VerifyProofDialog::VerifyProofDialog(Wallet *wallet, QWidget *parent) ui->input_formattedProof->setFont(ModelUtils::getMonospaceFont()); } -VerifyProofDialog::~VerifyProofDialog() -{ - delete ui; -} +VerifyProofDialog::~VerifyProofDialog() = default; void VerifyProofDialog::checkProof() { switch (ui->tabWidget->currentIndex()) { diff --git a/src/dialog/VerifyProofDialog.h b/src/dialog/VerifyProofDialog.h index 9159dec..62a70aa 100644 --- a/src/dialog/VerifyProofDialog.h +++ b/src/dialog/VerifyProofDialog.h @@ -31,7 +31,7 @@ private: void checkFormattedProof(); void proofStatus(bool success, const QString &message); - Ui::VerifyProofDialog *ui; + QScopedPointer ui; Wallet *m_wallet; QPixmap m_success; diff --git a/src/dialog/ViewOnlyDialog.cpp b/src/dialog/ViewOnlyDialog.cpp index 2a6b88b..9c35dc9 100644 --- a/src/dialog/ViewOnlyDialog.cpp +++ b/src/dialog/ViewOnlyDialog.cpp @@ -54,7 +54,4 @@ void ViewOnlyDialog::copyToClipboad() { Utils::copyToClipboard(text); } -ViewOnlyDialog::~ViewOnlyDialog() -{ - delete ui; -} +ViewOnlyDialog::~ViewOnlyDialog() = default; diff --git a/src/dialog/ViewOnlyDialog.h b/src/dialog/ViewOnlyDialog.h index 50caa38..15e253a 100644 --- a/src/dialog/ViewOnlyDialog.h +++ b/src/dialog/ViewOnlyDialog.h @@ -23,7 +23,7 @@ private slots: void onWriteViewOnlyWallet(); private: - Ui::ViewOnlyDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; void copyToClipboad(); }; diff --git a/src/dialog/WalletCacheDebugDialog.cpp b/src/dialog/WalletCacheDebugDialog.cpp index 3f1d2d7..3e82edf 100644 --- a/src/dialog/WalletCacheDebugDialog.cpp +++ b/src/dialog/WalletCacheDebugDialog.cpp @@ -91,7 +91,4 @@ void WalletCacheDebugDialog::setOutput(const QString &output) { ui->output->setPlainText(output); } -WalletCacheDebugDialog::~WalletCacheDebugDialog() { - delete ui; -} - +WalletCacheDebugDialog::~WalletCacheDebugDialog() = default; diff --git a/src/dialog/WalletCacheDebugDialog.h b/src/dialog/WalletCacheDebugDialog.h index e2ba3c7..3f7ca07 100644 --- a/src/dialog/WalletCacheDebugDialog.h +++ b/src/dialog/WalletCacheDebugDialog.h @@ -21,7 +21,7 @@ public: private: void setOutput(const QString &output); - Ui::WalletCacheDebugDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; }; diff --git a/src/dialog/WalletInfoDialog.cpp b/src/dialog/WalletInfoDialog.cpp index 58cfaee..663d8c0 100644 --- a/src/dialog/WalletInfoDialog.cpp +++ b/src/dialog/WalletInfoDialog.cpp @@ -27,9 +27,7 @@ WalletInfoDialog::WalletInfoDialog(QSharedPointer ctx, QWidget *pare this->adjustSize(); } -WalletInfoDialog::~WalletInfoDialog() { - delete ui; -} +WalletInfoDialog::~WalletInfoDialog() = default; void WalletInfoDialog::openWalletDir() { QFileInfo file(m_ctx->wallet->keysPath()); diff --git a/src/dialog/WalletInfoDialog.h b/src/dialog/WalletInfoDialog.h index 3764732..9ab4c25 100644 --- a/src/dialog/WalletInfoDialog.h +++ b/src/dialog/WalletInfoDialog.h @@ -23,7 +23,7 @@ public: private: void openWalletDir(); - Ui::WalletInfoDialog *ui; + QScopedPointer ui; QSharedPointer m_ctx; }; diff --git a/src/historywidget.cpp b/src/historywidget.cpp index ccff54b..4c347d3 100644 --- a/src/historywidget.cpp +++ b/src/historywidget.cpp @@ -181,6 +181,4 @@ void HistoryWidget::showSyncNoticeMsg() { "To update the history page during synchronization press Ctrl+R."); } -HistoryWidget::~HistoryWidget() { - delete ui; -} +HistoryWidget::~HistoryWidget() = default; \ No newline at end of file diff --git a/src/historywidget.h b/src/historywidget.h index a41a262..05434c6 100644 --- a/src/historywidget.h +++ b/src/historywidget.h @@ -56,7 +56,7 @@ private: void showContextMenu(const QPoint &point); void showSyncNoticeMsg(); - Ui::HistoryWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; QMenu *m_contextMenu; QMenu *m_copyMenu; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 22d78a6..4eb5797 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1424,6 +1424,4 @@ void MainWindow::toggleSearchbar(bool visible) { m_receiveWidget->focusSearchbar(); } -MainWindow::~MainWindow() { - delete ui; -} +MainWindow::~MainWindow() = default; \ No newline at end of file diff --git a/src/mainwindow.h b/src/mainwindow.h index 228a469..d76e008 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -206,7 +206,7 @@ private: void updateRecentlyOpened(const QString &filename); void updateWidgetIcons(); - Ui::MainWindow *ui; + QScopedPointer ui; WindowManager *m_windowManager; QSharedPointer m_ctx; diff --git a/src/qrcode_scanner/QrCodeScanDialog.cpp b/src/qrcode_scanner/QrCodeScanDialog.cpp index 502f308..2980f5c 100644 --- a/src/qrcode_scanner/QrCodeScanDialog.cpp +++ b/src/qrcode_scanner/QrCodeScanDialog.cpp @@ -119,5 +119,4 @@ QrCodeScanDialog::~QrCodeScanDialog() m_thread->terminate(); m_thread->wait(); } - delete ui; } \ No newline at end of file diff --git a/src/qrcode_scanner/QrCodeScanDialog.h b/src/qrcode_scanner/QrCodeScanDialog.h index 8227ed1..59fde5c 100644 --- a/src/qrcode_scanner/QrCodeScanDialog.h +++ b/src/qrcode_scanner/QrCodeScanDialog.h @@ -37,7 +37,7 @@ private: void displayCameraError(); void takeImage(); - Ui::QrCodeScanDialog *ui; + QScopedPointer ui; QScopedPointer m_camera; QScopedPointer m_imageCapture; diff --git a/src/receivewidget.cpp b/src/receivewidget.cpp index 68f4cee..373bc54 100644 --- a/src/receivewidget.cpp +++ b/src/receivewidget.cpp @@ -243,6 +243,4 @@ Monero::SubaddressRow* ReceiveWidget::currentEntry() { } } -ReceiveWidget::~ReceiveWidget() { - delete ui; -} +ReceiveWidget::~ReceiveWidget() = default; \ No newline at end of file diff --git a/src/receivewidget.h b/src/receivewidget.h index 8fa16e8..5957b87 100644 --- a/src/receivewidget.h +++ b/src/receivewidget.h @@ -50,7 +50,7 @@ private slots: void generateSubaddress(); private: - Ui::ReceiveWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; QMenu *m_headerMenu; QAction *m_showFullAddressesAction; diff --git a/src/sendwidget.cpp b/src/sendwidget.cpp index 60f3fdc..7e6a0d4 100644 --- a/src/sendwidget.cpp +++ b/src/sendwidget.cpp @@ -302,6 +302,4 @@ void SendWidget::skinChanged() { } } -SendWidget::~SendWidget() { - delete ui; -} +SendWidget::~SendWidget() = default; \ No newline at end of file diff --git a/src/sendwidget.h b/src/sendwidget.h index f72b985..506e9f6 100644 --- a/src/sendwidget.h +++ b/src/sendwidget.h @@ -48,7 +48,7 @@ private: void setupComboBox(); double amountDouble(); - Ui::SendWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; quint64 amount(); double conversionAmount(); diff --git a/src/settings.cpp b/src/settings.cpp index fe3eb2c..e29c4e9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -194,6 +194,4 @@ void Settings::setupLocalMoneroFrontendCombobox() { ui->combo_localMoneroFrontend->setCurrentIndex(ui->combo_localMoneroFrontend->findData(config()->get(Config::localMoneroFrontend).toString())); } -Settings::~Settings() { - delete ui; -} +Settings::~Settings() = default; \ No newline at end of file diff --git a/src/settings.h b/src/settings.h index 24d01db..eab1094 100644 --- a/src/settings.h +++ b/src/settings.h @@ -50,7 +50,7 @@ private: void setupSkinCombobox(); void setupLocalMoneroFrontendCombobox(); - Ui::Settings *ui; + QScopedPointer ui; QSharedPointer m_ctx; QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"}; diff --git a/src/widgets/LocalMoneroWidget.cpp b/src/widgets/LocalMoneroWidget.cpp index db3c31b..ffbb615 100644 --- a/src/widgets/LocalMoneroWidget.cpp +++ b/src/widgets/LocalMoneroWidget.cpp @@ -143,10 +143,6 @@ void LocalMoneroWidget::searchOffers(int page) { m_api->sellMoneroOnline(currencyCode, countryCode, paymentMethod, amount, page); } -LocalMoneroWidget::~LocalMoneroWidget() { - delete ui; -} - void LocalMoneroWidget::showContextMenu(const QPoint &point) { QModelIndex index = ui->treeView->indexAt(point); if (!index.isValid()) { @@ -207,4 +203,6 @@ void LocalMoneroWidget::updatePaymentMethods() { ui->combo_paymentMethod->addItem(name, payment_method); } } -} \ No newline at end of file +} + +LocalMoneroWidget::~LocalMoneroWidget() = default; \ No newline at end of file diff --git a/src/widgets/LocalMoneroWidget.h b/src/widgets/LocalMoneroWidget.h index 4c08878..baa0d7a 100644 --- a/src/widgets/LocalMoneroWidget.h +++ b/src/widgets/LocalMoneroWidget.h @@ -41,7 +41,7 @@ private: void viewOfferDetails(); void updatePaymentMethods(); - Ui::LocalMoneroWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; int m_currentPage = 0; diff --git a/src/widgets/RestoreHeightWidget.cpp b/src/widgets/RestoreHeightWidget.cpp index b3250f1..eb70052 100644 --- a/src/widgets/RestoreHeightWidget.cpp +++ b/src/widgets/RestoreHeightWidget.cpp @@ -56,6 +56,4 @@ void RestoreHeightWidget::onRestoreHeightChanged() { ui->line_creationDate->setText(date.toString("yyyy-MM-dd")); } -RestoreHeightWidget::~RestoreHeightWidget() { - delete ui; -} \ No newline at end of file +RestoreHeightWidget::~RestoreHeightWidget() = default; \ No newline at end of file diff --git a/src/widgets/RestoreHeightWidget.h b/src/widgets/RestoreHeightWidget.h index a7f466b..1702f81 100644 --- a/src/widgets/RestoreHeightWidget.h +++ b/src/widgets/RestoreHeightWidget.h @@ -26,7 +26,7 @@ private slots: void onRestoreHeightChanged(); private: - Ui::RestoreHeightWidget *ui; + QScopedPointer ui; }; diff --git a/src/widgets/TickerWidget.cpp b/src/widgets/TickerWidget.cpp index d8458ff..a8f656c 100644 --- a/src/widgets/TickerWidget.cpp +++ b/src/widgets/TickerWidget.cpp @@ -21,9 +21,7 @@ TickerWidgetBase::TickerWidgetBase(QWidget *parent, QSharedPointer c ui->tickerFiat->setText("..."); } -TickerWidgetBase::~TickerWidgetBase() { - delete ui; -} +TickerWidgetBase::~TickerWidgetBase() = default; void TickerWidgetBase::setTitle(const QString &title) { ui->tickerBox->setTitle(title); diff --git a/src/widgets/TickerWidget.h b/src/widgets/TickerWidget.h index cd586bf..73a4f88 100644 --- a/src/widgets/TickerWidget.h +++ b/src/widgets/TickerWidget.h @@ -30,7 +30,7 @@ public slots: virtual void updateDisplay() = 0; private: - Ui::TickerWidget *ui; + QScopedPointer ui; protected: QSharedPointer m_ctx; diff --git a/src/widgets/ccswidget.cpp b/src/widgets/ccswidget.cpp index a170ad6..443c37d 100644 --- a/src/widgets/ccswidget.cpp +++ b/src/widgets/ccswidget.cpp @@ -69,6 +69,4 @@ void CCSWidget::showContextMenu(const QPoint &pos) { m_contextMenu->exec(ui->tableView->viewport()->mapToGlobal(pos)); } -CCSWidget::~CCSWidget() { - delete ui; -} +CCSWidget::~CCSWidget() = default; \ No newline at end of file diff --git a/src/widgets/ccswidget.h b/src/widgets/ccswidget.h index 9fa367c..91d5e2c 100644 --- a/src/widgets/ccswidget.h +++ b/src/widgets/ccswidget.h @@ -40,7 +40,7 @@ private: void setupTable(); void showContextMenu(const QPoint &pos); - Ui::CSSWidget *ui; + QScopedPointer ui; CCSModel *m_model; QMenu *m_contextMenu; }; diff --git a/src/widgets/nodewidget.cpp b/src/widgets/nodewidget.cpp index 94b857c..af63095 100644 --- a/src/widgets/nodewidget.cpp +++ b/src/widgets/nodewidget.cpp @@ -188,6 +188,4 @@ NodeModel* NodeWidget::model() { return m_wsModel; } -NodeWidget::~NodeWidget() { - delete ui; -} +NodeWidget::~NodeWidget() = default; diff --git a/src/widgets/nodewidget.h b/src/widgets/nodewidget.h index e7fa10d..fd2c2e7 100644 --- a/src/widgets/nodewidget.h +++ b/src/widgets/nodewidget.h @@ -44,8 +44,8 @@ signals: void nodeSourceChanged(NodeSource nodeSource); private: + QScopedPointer ui; QSharedPointer m_ctx; - Ui::NodeWidget *ui; NodeModel* m_customModel; NodeModel* m_wsModel; diff --git a/src/widgets/redditwidget.cpp b/src/widgets/redditwidget.cpp index 386c086..c0e1411 100644 --- a/src/widgets/redditwidget.cpp +++ b/src/widgets/redditwidget.cpp @@ -74,6 +74,4 @@ QString RedditWidget::getLink(const QString &permaLink) { return QString("https://%1%2").arg(redditFrontend, permaLink); } -RedditWidget::~RedditWidget() { - delete ui; -} +RedditWidget::~RedditWidget() = default; \ No newline at end of file diff --git a/src/widgets/redditwidget.h b/src/widgets/redditwidget.h index d5d8fc1..714c82f 100644 --- a/src/widgets/redditwidget.h +++ b/src/widgets/redditwidget.h @@ -35,7 +35,7 @@ private: void copyUrl(); QString getLink(const QString &permaLink); - Ui::RedditWidget *ui; + QScopedPointer ui; RedditModel* const m_model; QMenu *m_contextMenu; }; diff --git a/src/widgets/xmrigwidget.cpp b/src/widgets/xmrigwidget.cpp index aef8e7c..c67556d 100644 --- a/src/widgets/xmrigwidget.cpp +++ b/src/widgets/xmrigwidget.cpp @@ -300,6 +300,4 @@ QStandardItemModel *XMRigWidget::model() { return m_model; } -XMRigWidget::~XMRigWidget() { - delete ui; -} +XMRigWidget::~XMRigWidget() = default; \ No newline at end of file diff --git a/src/widgets/xmrigwidget.h b/src/widgets/xmrigwidget.h index fd800a4..03053cf 100644 --- a/src/widgets/xmrigwidget.h +++ b/src/widgets/xmrigwidget.h @@ -51,7 +51,7 @@ signals: private: void showContextMenu(const QPoint &pos); - Ui::XMRigWidget *ui; + QScopedPointer ui; QSharedPointer m_ctx; XmRig * m_XMRig; QStandardItemModel *m_model;