UI: use QScopedPointer

This commit is contained in:
tobtoht 2021-06-27 14:13:05 +02:00
parent 1afa06af91
commit bc21aed5af
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
92 changed files with 95 additions and 198 deletions

View file

@ -144,6 +144,4 @@ void CalcWidget::setupComboBox(QComboBox *comboBox, const QStringList &crypto, c
comboBox->addItems(fiat); comboBox->addItems(fiat);
} }
CalcWidget::~CalcWidget() { CalcWidget::~CalcWidget() = default;
delete ui;
}

View file

@ -31,7 +31,7 @@ private:
void convert(bool reverse); void convert(bool reverse);
void setupComboBox(QComboBox *comboBox, const QStringList &crypto, const QStringList &fiat); void setupComboBox(QComboBox *comboBox, const QStringList &crypto, const QStringList &fiat);
Ui::CalcWidget *ui; QScopedPointer<Ui::CalcWidget> ui;
bool m_comboBoxInit = false; bool m_comboBoxInit = false;
}; };

View file

@ -23,6 +23,4 @@ void CalcWindow::closeEvent(QCloseEvent *foo) {
emit closed(); emit closed();
} }
CalcWindow::~CalcWindow() { CalcWindow::~CalcWindow() = default;
delete ui;
}

View file

@ -25,7 +25,7 @@ private:
void closeEvent(QCloseEvent *bar) override; void closeEvent(QCloseEvent *bar) override;
private: private:
Ui::CalcWindow *ui; QScopedPointer<Ui::CalcWindow> ui;
}; };
#endif // CalcWindow_H #endif // CalcWindow_H

View file

@ -243,6 +243,4 @@ void CoinsWidget::thawCoins(const QVector<int> &indexes) {
m_ctx->updateBalance(); m_ctx->updateBalance();
} }
CoinsWidget::~CoinsWidget() { CoinsWidget::~CoinsWidget() = default;
delete ui;
}

View file

@ -50,7 +50,7 @@ private:
Amount Amount
}; };
Ui::CoinsWidget *ui; QScopedPointer<Ui::CoinsWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QMenu *m_contextMenu; QMenu *m_contextMenu;

View file

@ -150,7 +150,4 @@ void ContactsWidget::deleteContact()
m_model->deleteRow(m_proxyModel->mapToSource(index).row()); m_model->deleteRow(m_proxyModel->mapToSource(index).row());
} }
ContactsWidget::~ContactsWidget() ContactsWidget::~ContactsWidget() = default;
{
delete ui;
}

View file

@ -42,7 +42,7 @@ private slots:
void showHeaderMenu(const QPoint &position); void showHeaderMenu(const QPoint &position);
private: private:
Ui::ContactsWidget *ui; QScopedPointer<Ui::ContactsWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QAction *m_showFullAddressesAction; QAction *m_showFullAddressesAction;

View file

@ -38,7 +38,5 @@ AboutDialog::AboutDialog(QWidget *parent)
this->adjustSize(); this->adjustSize();
} }
AboutDialog::~AboutDialog() { AboutDialog::~AboutDialog() = default;
delete ui;
}

View file

@ -21,7 +21,7 @@ public:
~AboutDialog() override; ~AboutDialog() override;
private: private:
Ui::AboutDialog *ui; QScopedPointer<Ui::AboutDialog> ui;
QStringListModel *m_model; QStringListModel *m_model;
}; };

View file

@ -103,6 +103,4 @@ Monero::SubaddressAccountRow* AccountSwitcherDialog::currentEntry() {
return m_ctx->wallet->subaddressAccountModel()->entryFromIndex(index); return m_ctx->wallet->subaddressAccountModel()->entryFromIndex(index);
} }
AccountSwitcherDialog::~AccountSwitcherDialog() { AccountSwitcherDialog::~AccountSwitcherDialog() = default;
delete ui;
}

View file

@ -33,7 +33,7 @@ private:
Monero::SubaddressAccountRow* currentEntry(); Monero::SubaddressAccountRow* currentEntry();
Ui::AccountSwitcherDialog *ui; QScopedPointer<Ui::AccountSwitcherDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
SubaddressAccountModel *m_model; SubaddressAccountModel *m_model;
SubaddressAccountProxyModel *m_proxyModel; SubaddressAccountProxyModel *m_proxyModel;

View file

@ -22,6 +22,4 @@ BalanceDialog::BalanceDialog(QWidget *parent, Wallet *wallet)
this->adjustSize(); this->adjustSize();
} }
BalanceDialog::~BalanceDialog() { BalanceDialog::~BalanceDialog() = default;
delete ui;
}

View file

@ -21,7 +21,7 @@ public:
~BalanceDialog() override; ~BalanceDialog() override;
private: private:
Ui::BalanceDialog *ui; QScopedPointer<Ui::BalanceDialog> ui;
}; };
#endif //FEATHER_BALANCEDIALOG_H #endif //FEATHER_BALANCEDIALOG_H

View file

@ -56,6 +56,4 @@ void BroadcastTxDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) {
} }
} }
BroadcastTxDialog::~BroadcastTxDialog() { BroadcastTxDialog::~BroadcastTxDialog() = default;
delete ui;
}

View file

@ -25,7 +25,7 @@ private slots:
void onApiResponse(const DaemonRpc::DaemonResponse &resp); void onApiResponse(const DaemonRpc::DaemonResponse &resp);
private: private:
Ui::BroadcastTxDialog *ui; QScopedPointer<Ui::BroadcastTxDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
UtilsNetworking *m_network; UtilsNetworking *m_network;
DaemonRpc *m_rpc; DaemonRpc *m_rpc;

View file

@ -97,6 +97,4 @@ void CalcConfigDialog::fillListWidgets() {
setChecked(ui->list_fiat, checkedFiatCurrencies); setChecked(ui->list_fiat, checkedFiatCurrencies);
} }
CalcConfigDialog::~CalcConfigDialog() { CalcConfigDialog::~CalcConfigDialog() = default;
delete ui;
}

View file

@ -32,7 +32,7 @@ private:
void fillListWidgets(); void fillListWidgets();
QListWidget* getVisibleListWidget(); QListWidget* getVisibleListWidget();
Ui::CalcConfigDialog *ui; QScopedPointer<Ui::CalcConfigDialog> ui;
}; };

View file

@ -25,10 +25,7 @@ ContactsDialog::ContactsDialog(QWidget *parent, const QString &address, const QS
this->adjustSize(); this->adjustSize();
} }
ContactsDialog::~ContactsDialog() ContactsDialog::~ContactsDialog() = default;
{
delete ui;
}
QString ContactsDialog::getAddress() { QString ContactsDialog::getAddress() {
return m_address; return m_address;

View file

@ -22,7 +22,7 @@ public:
QString getName(); QString getName();
private: private:
Ui::ContactsDialog *ui; QScopedPointer<Ui::ContactsDialog> ui;
QString m_address; QString m_address;
QString m_name; QString m_name;

View file

@ -146,6 +146,4 @@ void DebugInfoDialog::copyToClipboad() {
Utils::copyToClipboard(text); Utils::copyToClipboard(text);
} }
DebugInfoDialog::~DebugInfoDialog() { DebugInfoDialog::~DebugInfoDialog() = default;
delete ui;
}

View file

@ -25,7 +25,7 @@ private:
void copyToClipboad(); void copyToClipboad();
void updateInfo(); void updateInfo();
Ui::DebugInfoDialog *ui; QScopedPointer<Ui::DebugInfoDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QTimer m_updateTimer; QTimer m_updateTimer;

View file

@ -14,6 +14,4 @@ InfoDialog::InfoDialog(QWidget *parent, const QString &title, const QString &inf
ui->info->setPlainText(infoData); ui->info->setPlainText(infoData);
} }
InfoDialog::~InfoDialog() { InfoDialog::~InfoDialog() = default;
delete ui;
}

View file

@ -19,7 +19,7 @@ public:
~InfoDialog() override; ~InfoDialog() override;
private: private:
Ui::InfoDialog *ui; QScopedPointer<Ui::InfoDialog> ui;
}; };

View file

@ -22,7 +22,4 @@ KeysDialog::KeysDialog(QSharedPointer<AppContext> ctx, QWidget *parent)
this->adjustSize(); this->adjustSize();
} }
KeysDialog::~KeysDialog() KeysDialog::~KeysDialog() = default;
{
delete ui;
}

View file

@ -20,7 +20,7 @@ public:
~KeysDialog() override; ~KeysDialog() override;
private: private:
Ui::KeysDialog *ui; QScopedPointer<Ui::KeysDialog> ui;
}; };

View file

@ -46,6 +46,4 @@ void LocalMoneroInfoDialog::onGoToOffer() {
Utils::externalLinkWarning(this, offerUrl); Utils::externalLinkWarning(this, offerUrl);
} }
LocalMoneroInfoDialog::~LocalMoneroInfoDialog() { LocalMoneroInfoDialog::~LocalMoneroInfoDialog() = default;
delete ui;
}

View file

@ -26,7 +26,7 @@ private slots:
private: private:
void setLabelText(QLabel *label, LocalMoneroModel::Column column); void setLabelText(QLabel *label, LocalMoneroModel::Column column);
Ui::LocalMoneroInfoDialog *ui; QScopedPointer<Ui::LocalMoneroInfoDialog> ui;
LocalMoneroModel *m_model; LocalMoneroModel *m_model;
int m_row; int m_row;
}; };

View file

@ -37,6 +37,4 @@ OutputInfoDialog::OutputInfoDialog(CoinsInfo *cInfo, QWidget *parent)
this->adjustSize(); this->adjustSize();
} }
OutputInfoDialog::~OutputInfoDialog() { OutputInfoDialog::~OutputInfoDialog() = default;
delete ui;
}

View file

@ -21,7 +21,7 @@ public:
~OutputInfoDialog() override; ~OutputInfoDialog() override;
private: private:
Ui::OutputInfoDialog *ui; QScopedPointer<Ui::OutputInfoDialog> ui;
}; };

View file

@ -40,11 +40,6 @@ OutputSweepDialog::OutputSweepDialog(QWidget *parent, CoinsInfo* coin)
this->adjustSize(); this->adjustSize();
} }
OutputSweepDialog::~OutputSweepDialog()
{
delete ui;
}
QString OutputSweepDialog::address() { QString OutputSweepDialog::address() {
return m_address; return m_address;
} }
@ -55,4 +50,6 @@ bool OutputSweepDialog::churn() const {
int OutputSweepDialog::outputs() const { int OutputSweepDialog::outputs() const {
return m_outputs; return m_outputs;
} }
OutputSweepDialog::~OutputSweepDialog() = default;

View file

@ -24,7 +24,7 @@ public:
int outputs() const; int outputs() const;
private: private:
Ui::OutputSweepDialog *ui; QScopedPointer<Ui::OutputSweepDialog> ui;
uint64_t m_amount; uint64_t m_amount;

View file

@ -40,10 +40,7 @@ PasswordChangeDialog::PasswordChangeDialog(QWidget *parent, Wallet *wallet)
this->adjustSize(); this->adjustSize();
} }
PasswordChangeDialog::~PasswordChangeDialog() PasswordChangeDialog::~PasswordChangeDialog() = default;
{
delete ui;
}
void PasswordChangeDialog::passwordsMatch() { void PasswordChangeDialog::passwordsMatch() {
bool match = ui->lineEdit_newPassword->text() == ui->lineEdit_confirmPassword->text(); bool match = ui->lineEdit_newPassword->text() == ui->lineEdit_confirmPassword->text();

View file

@ -20,7 +20,7 @@ public:
~PasswordChangeDialog() override; ~PasswordChangeDialog() override;
private: private:
Ui::PasswordChangeDialog *ui; QScopedPointer<Ui::PasswordChangeDialog> ui;
Wallet *m_wallet; Wallet *m_wallet;
void passwordsMatch(); void passwordsMatch();

View file

@ -22,7 +22,4 @@ PasswordDialog::PasswordDialog(const QString &walletName, bool incorrectPassword
this->adjustSize(); this->adjustSize();
} }
PasswordDialog::~PasswordDialog() PasswordDialog::~PasswordDialog() = default;
{
delete ui;
}

View file

@ -21,7 +21,7 @@ public:
QString password = ""; QString password = "";
private: private:
Ui::PasswordDialog *ui; QScopedPointer<Ui::PasswordDialog> ui;
}; };
#endif //FEATHER_PASSWORDDIALOG_H #endif //FEATHER_PASSWORDDIALOG_H

View file

@ -27,10 +27,7 @@ QrCodeDialog::QrCodeDialog(QWidget *parent, const QrCode &qrCode, const QString
this->adjustSize(); this->adjustSize();
} }
QrCodeDialog::~QrCodeDialog() QrCodeDialog::~QrCodeDialog() = default;
{
delete ui;
}
void QrCodeDialog::setQrCode(const QrCode &qrCode) { void QrCodeDialog::setQrCode(const QrCode &qrCode) {
m_pixmap = qrCode.toPixmap(1).scaled(500, 500, Qt::KeepAspectRatio); m_pixmap = qrCode.toPixmap(1).scaled(500, 500, Qt::KeepAspectRatio);

View file

@ -24,7 +24,7 @@ private:
void copyImage(); void copyImage();
void saveImage(); void saveImage();
Ui::QrCodeDialog *ui; QScopedPointer<Ui::QrCodeDialog> ui;
QPixmap m_pixmap; QPixmap m_pixmap;
}; };

View file

@ -62,7 +62,4 @@ void SeedDialog::setSeed(const QString &seed) {
"</ul>").arg(words)); "</ul>").arg(words));
} }
SeedDialog::~SeedDialog() SeedDialog::~SeedDialog() = default;
{
delete ui;
}

View file

@ -22,7 +22,7 @@ public:
private: private:
void setSeed(const QString &seed); void setSeed(const QString &seed);
Ui::SeedDialog *ui; QScopedPointer<Ui::SeedDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
}; };

View file

@ -52,7 +52,4 @@ void SignVerifyDialog::copyToClipboard() {
Utils::copyToClipboard(sig.join("\n")); Utils::copyToClipboard(sig.join("\n"));
} }
SignVerifyDialog::~SignVerifyDialog() SignVerifyDialog::~SignVerifyDialog() = default;
{
delete ui;
}

View file

@ -20,7 +20,7 @@ public:
~SignVerifyDialog() override; ~SignVerifyDialog() override;
private: private:
Ui::SignVerifyDialog *ui; QScopedPointer<Ui::SignVerifyDialog> ui;
Wallet *m_wallet; Wallet *m_wallet;
private slots: private slots:

View file

@ -29,6 +29,4 @@ void SplashDialog::setIcon(const QPixmap &icon) {
ui->icon->setPixmap(icon.scaledToWidth(32, Qt::SmoothTransformation)); ui->icon->setPixmap(icon.scaledToWidth(32, Qt::SmoothTransformation));
} }
SplashDialog::~SplashDialog() { SplashDialog::~SplashDialog() = default;
delete ui;
}

View file

@ -22,7 +22,7 @@ public:
void setIcon(const QPixmap &icon); void setIcon(const QPixmap &icon);
private: private:
Ui::SplashDialog *ui; QScopedPointer<Ui::SplashDialog> ui;
}; };
#endif //FEATHER_SPLASHDIALOG_H #endif //FEATHER_SPLASHDIALOG_H

View file

@ -165,6 +165,4 @@ void TorInfoDialog::onShowInitSyncConfigDialog() {
} }
} }
TorInfoDialog::~TorInfoDialog() { TorInfoDialog::~TorInfoDialog() = default;
delete ui;
}

View file

@ -38,7 +38,7 @@ private:
void initConnectionSettings(); void initConnectionSettings();
void initPrivacyLevel(); void initPrivacyLevel();
Ui::TorInfoDialog *ui; QScopedPointer<Ui::TorInfoDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
}; };

View file

@ -134,6 +134,4 @@ void TransactionInfoDialog::createTxProof() {
m_txProofDialog->show(); m_txProofDialog->show();
} }
TransactionInfoDialog::~TransactionInfoDialog() { TransactionInfoDialog::~TransactionInfoDialog() = default;
delete ui;
}

View file

@ -31,7 +31,7 @@ private:
void setData(TransactionInfo* tx); void setData(TransactionInfo* tx);
void updateData(); void updateData();
Ui::TransactionInfoDialog *ui; QScopedPointer<Ui::TransactionInfoDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
TransactionInfo *m_txInfo; TransactionInfo *m_txInfo;

View file

@ -184,6 +184,4 @@ void TxConfAdvDialog::closeDialog() {
QDialog::reject(); QDialog::reject();
} }
TxConfAdvDialog::~TxConfAdvDialog() { TxConfAdvDialog::~TxConfAdvDialog() = default;
delete ui;
}

View file

@ -42,7 +42,7 @@ private:
void signedQrCode(); void signedQrCode();
void signedSaveFile(); void signedSaveFile();
Ui::TxConfAdvDialog *ui; QScopedPointer<Ui::TxConfAdvDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
PendingTransaction *m_tx = nullptr; PendingTransaction *m_tx = nullptr;
UnsignedTransaction *m_utx = nullptr; UnsignedTransaction *m_utx = nullptr;

View file

@ -86,6 +86,4 @@ void TxConfDialog::setShowAdvanced() {
QDialog::reject(); QDialog::reject();
} }
TxConfDialog::~TxConfDialog() { TxConfDialog::~TxConfDialog() = default;
delete ui;
}

View file

@ -26,7 +26,7 @@ public:
private: private:
void setShowAdvanced(); void setShowAdvanced();
Ui::TxConfDialog *ui; QScopedPointer<Ui::TxConfDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
PendingTransaction *m_tx; PendingTransaction *m_tx;
QString m_address; QString m_address;

View file

@ -100,6 +100,4 @@ void TxImportDialog::onImport() {
m_ctx->refreshModels(); m_ctx->refreshModels();
} }
TxImportDialog::~TxImportDialog() { TxImportDialog::~TxImportDialog() = default;
delete ui;
}

View file

@ -26,7 +26,7 @@ private slots:
void onApiResponse(const DaemonRpc::DaemonResponse &resp); void onApiResponse(const DaemonRpc::DaemonResponse &resp);
private: private:
Ui::TxImportDialog *ui; QScopedPointer<Ui::TxImportDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
UtilsNetworking *m_network; UtilsNetworking *m_network;

View file

@ -226,7 +226,5 @@ TxProof TxProofDialog::getProof() {
return proof; return proof;
} }
TxProofDialog::~TxProofDialog() { TxProofDialog::~TxProofDialog() = default;
delete ui;
}

View file

@ -49,7 +49,7 @@ private:
Mode m_mode; Mode m_mode;
TransactionInfo::Direction m_direction; TransactionInfo::Direction m_direction;
Ui::TxProofDialog *ui; QScopedPointer<Ui::TxProofDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
}; };

View file

@ -223,6 +223,4 @@ void UpdateDialog::setStatus(const QString &msg, bool success) {
ui->label_body->setStyleSheet(""); ui->label_body->setStyleSheet("");
} }
UpdateDialog::~UpdateDialog() { UpdateDialog::~UpdateDialog() = default;
delete ui;
}

View file

@ -34,7 +34,7 @@ signals:
private: private:
void setStatus(const QString &msg, bool success = false); void setStatus(const QString &msg, bool success = false);
Ui::UpdateDialog *ui; QScopedPointer<Ui::UpdateDialog> ui;
QString m_version; QString m_version;
QString m_downloadUrl; QString m_downloadUrl;

View file

@ -53,10 +53,7 @@ VerifyProofDialog::VerifyProofDialog(Wallet *wallet, QWidget *parent)
ui->input_formattedProof->setFont(ModelUtils::getMonospaceFont()); ui->input_formattedProof->setFont(ModelUtils::getMonospaceFont());
} }
VerifyProofDialog::~VerifyProofDialog() VerifyProofDialog::~VerifyProofDialog() = default;
{
delete ui;
}
void VerifyProofDialog::checkProof() { void VerifyProofDialog::checkProof() {
switch (ui->tabWidget->currentIndex()) { switch (ui->tabWidget->currentIndex()) {

View file

@ -31,7 +31,7 @@ private:
void checkFormattedProof(); void checkFormattedProof();
void proofStatus(bool success, const QString &message); void proofStatus(bool success, const QString &message);
Ui::VerifyProofDialog *ui; QScopedPointer<Ui::VerifyProofDialog> ui;
Wallet *m_wallet; Wallet *m_wallet;
QPixmap m_success; QPixmap m_success;

View file

@ -54,7 +54,4 @@ void ViewOnlyDialog::copyToClipboad() {
Utils::copyToClipboard(text); Utils::copyToClipboard(text);
} }
ViewOnlyDialog::~ViewOnlyDialog() ViewOnlyDialog::~ViewOnlyDialog() = default;
{
delete ui;
}

View file

@ -23,7 +23,7 @@ private slots:
void onWriteViewOnlyWallet(); void onWriteViewOnlyWallet();
private: private:
Ui::ViewOnlyDialog *ui; QScopedPointer<Ui::ViewOnlyDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
void copyToClipboad(); void copyToClipboad();
}; };

View file

@ -91,7 +91,4 @@ void WalletCacheDebugDialog::setOutput(const QString &output) {
ui->output->setPlainText(output); ui->output->setPlainText(output);
} }
WalletCacheDebugDialog::~WalletCacheDebugDialog() { WalletCacheDebugDialog::~WalletCacheDebugDialog() = default;
delete ui;
}

View file

@ -21,7 +21,7 @@ public:
private: private:
void setOutput(const QString &output); void setOutput(const QString &output);
Ui::WalletCacheDebugDialog *ui; QScopedPointer<Ui::WalletCacheDebugDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
}; };

View file

@ -27,9 +27,7 @@ WalletInfoDialog::WalletInfoDialog(QSharedPointer<AppContext> ctx, QWidget *pare
this->adjustSize(); this->adjustSize();
} }
WalletInfoDialog::~WalletInfoDialog() { WalletInfoDialog::~WalletInfoDialog() = default;
delete ui;
}
void WalletInfoDialog::openWalletDir() { void WalletInfoDialog::openWalletDir() {
QFileInfo file(m_ctx->wallet->keysPath()); QFileInfo file(m_ctx->wallet->keysPath());

View file

@ -23,7 +23,7 @@ public:
private: private:
void openWalletDir(); void openWalletDir();
Ui::WalletInfoDialog *ui; QScopedPointer<Ui::WalletInfoDialog> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
}; };

View file

@ -181,6 +181,4 @@ void HistoryWidget::showSyncNoticeMsg() {
"To update the history page during synchronization press Ctrl+R."); "To update the history page during synchronization press Ctrl+R.");
} }
HistoryWidget::~HistoryWidget() { HistoryWidget::~HistoryWidget() = default;
delete ui;
}

View file

@ -56,7 +56,7 @@ private:
void showContextMenu(const QPoint &point); void showContextMenu(const QPoint &point);
void showSyncNoticeMsg(); void showSyncNoticeMsg();
Ui::HistoryWidget *ui; QScopedPointer<Ui::HistoryWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QMenu *m_contextMenu; QMenu *m_contextMenu;
QMenu *m_copyMenu; QMenu *m_copyMenu;

View file

@ -1424,6 +1424,4 @@ void MainWindow::toggleSearchbar(bool visible) {
m_receiveWidget->focusSearchbar(); m_receiveWidget->focusSearchbar();
} }
MainWindow::~MainWindow() { MainWindow::~MainWindow() = default;
delete ui;
}

View file

@ -206,7 +206,7 @@ private:
void updateRecentlyOpened(const QString &filename); void updateRecentlyOpened(const QString &filename);
void updateWidgetIcons(); void updateWidgetIcons();
Ui::MainWindow *ui; QScopedPointer<Ui::MainWindow> ui;
WindowManager *m_windowManager; WindowManager *m_windowManager;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;

View file

@ -119,5 +119,4 @@ QrCodeScanDialog::~QrCodeScanDialog()
m_thread->terminate(); m_thread->terminate();
m_thread->wait(); m_thread->wait();
} }
delete ui;
} }

View file

@ -37,7 +37,7 @@ private:
void displayCameraError(); void displayCameraError();
void takeImage(); void takeImage();
Ui::QrCodeScanDialog *ui; QScopedPointer<Ui::QrCodeScanDialog> ui;
QScopedPointer<QCamera> m_camera; QScopedPointer<QCamera> m_camera;
QScopedPointer<QCameraImageCapture> m_imageCapture; QScopedPointer<QCameraImageCapture> m_imageCapture;

View file

@ -243,6 +243,4 @@ Monero::SubaddressRow* ReceiveWidget::currentEntry() {
} }
} }
ReceiveWidget::~ReceiveWidget() { ReceiveWidget::~ReceiveWidget() = default;
delete ui;
}

View file

@ -50,7 +50,7 @@ private slots:
void generateSubaddress(); void generateSubaddress();
private: private:
Ui::ReceiveWidget *ui; QScopedPointer<Ui::ReceiveWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QMenu *m_headerMenu; QMenu *m_headerMenu;
QAction *m_showFullAddressesAction; QAction *m_showFullAddressesAction;

View file

@ -302,6 +302,4 @@ void SendWidget::skinChanged() {
} }
} }
SendWidget::~SendWidget() { SendWidget::~SendWidget() = default;
delete ui;
}

View file

@ -48,7 +48,7 @@ private:
void setupComboBox(); void setupComboBox();
double amountDouble(); double amountDouble();
Ui::SendWidget *ui; QScopedPointer<Ui::SendWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
quint64 amount(); quint64 amount();
double conversionAmount(); double conversionAmount();

View file

@ -194,6 +194,4 @@ void Settings::setupLocalMoneroFrontendCombobox() {
ui->combo_localMoneroFrontend->setCurrentIndex(ui->combo_localMoneroFrontend->findData(config()->get(Config::localMoneroFrontend).toString())); ui->combo_localMoneroFrontend->setCurrentIndex(ui->combo_localMoneroFrontend->findData(config()->get(Config::localMoneroFrontend).toString()));
} }
Settings::~Settings() { Settings::~Settings() = default;
delete ui;
}

View file

@ -50,7 +50,7 @@ private:
void setupSkinCombobox(); void setupSkinCombobox();
void setupLocalMoneroFrontendCombobox(); void setupLocalMoneroFrontendCombobox();
Ui::Settings *ui; QScopedPointer<Ui::Settings> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"}; QStringList m_skins{"Native", "QDarkStyle", "Breeze/Dark", "Breeze/Light"};

View file

@ -143,10 +143,6 @@ void LocalMoneroWidget::searchOffers(int page) {
m_api->sellMoneroOnline(currencyCode, countryCode, paymentMethod, amount, page); m_api->sellMoneroOnline(currencyCode, countryCode, paymentMethod, amount, page);
} }
LocalMoneroWidget::~LocalMoneroWidget() {
delete ui;
}
void LocalMoneroWidget::showContextMenu(const QPoint &point) { void LocalMoneroWidget::showContextMenu(const QPoint &point) {
QModelIndex index = ui->treeView->indexAt(point); QModelIndex index = ui->treeView->indexAt(point);
if (!index.isValid()) { if (!index.isValid()) {
@ -207,4 +203,6 @@ void LocalMoneroWidget::updatePaymentMethods() {
ui->combo_paymentMethod->addItem(name, payment_method); ui->combo_paymentMethod->addItem(name, payment_method);
} }
} }
} }
LocalMoneroWidget::~LocalMoneroWidget() = default;

View file

@ -41,7 +41,7 @@ private:
void viewOfferDetails(); void viewOfferDetails();
void updatePaymentMethods(); void updatePaymentMethods();
Ui::LocalMoneroWidget *ui; QScopedPointer<Ui::LocalMoneroWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
int m_currentPage = 0; int m_currentPage = 0;

View file

@ -56,6 +56,4 @@ void RestoreHeightWidget::onRestoreHeightChanged() {
ui->line_creationDate->setText(date.toString("yyyy-MM-dd")); ui->line_creationDate->setText(date.toString("yyyy-MM-dd"));
} }
RestoreHeightWidget::~RestoreHeightWidget() { RestoreHeightWidget::~RestoreHeightWidget() = default;
delete ui;
}

View file

@ -26,7 +26,7 @@ private slots:
void onRestoreHeightChanged(); void onRestoreHeightChanged();
private: private:
Ui::RestoreHeightWidget *ui; QScopedPointer<Ui::RestoreHeightWidget> ui;
}; };

View file

@ -21,9 +21,7 @@ TickerWidgetBase::TickerWidgetBase(QWidget *parent, QSharedPointer<AppContext> c
ui->tickerFiat->setText("..."); ui->tickerFiat->setText("...");
} }
TickerWidgetBase::~TickerWidgetBase() { TickerWidgetBase::~TickerWidgetBase() = default;
delete ui;
}
void TickerWidgetBase::setTitle(const QString &title) { void TickerWidgetBase::setTitle(const QString &title) {
ui->tickerBox->setTitle(title); ui->tickerBox->setTitle(title);

View file

@ -30,7 +30,7 @@ public slots:
virtual void updateDisplay() = 0; virtual void updateDisplay() = 0;
private: private:
Ui::TickerWidget *ui; QScopedPointer<Ui::TickerWidget> ui;
protected: protected:
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;

View file

@ -69,6 +69,4 @@ void CCSWidget::showContextMenu(const QPoint &pos) {
m_contextMenu->exec(ui->tableView->viewport()->mapToGlobal(pos)); m_contextMenu->exec(ui->tableView->viewport()->mapToGlobal(pos));
} }
CCSWidget::~CCSWidget() { CCSWidget::~CCSWidget() = default;
delete ui;
}

View file

@ -40,7 +40,7 @@ private:
void setupTable(); void setupTable();
void showContextMenu(const QPoint &pos); void showContextMenu(const QPoint &pos);
Ui::CSSWidget *ui; QScopedPointer<Ui::CSSWidget> ui;
CCSModel *m_model; CCSModel *m_model;
QMenu *m_contextMenu; QMenu *m_contextMenu;
}; };

View file

@ -188,6 +188,4 @@ NodeModel* NodeWidget::model() {
return m_wsModel; return m_wsModel;
} }
NodeWidget::~NodeWidget() { NodeWidget::~NodeWidget() = default;
delete ui;
}

View file

@ -44,8 +44,8 @@ signals:
void nodeSourceChanged(NodeSource nodeSource); void nodeSourceChanged(NodeSource nodeSource);
private: private:
QScopedPointer<Ui::NodeWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
Ui::NodeWidget *ui;
NodeModel* m_customModel; NodeModel* m_customModel;
NodeModel* m_wsModel; NodeModel* m_wsModel;

View file

@ -74,6 +74,4 @@ QString RedditWidget::getLink(const QString &permaLink) {
return QString("https://%1%2").arg(redditFrontend, permaLink); return QString("https://%1%2").arg(redditFrontend, permaLink);
} }
RedditWidget::~RedditWidget() { RedditWidget::~RedditWidget() = default;
delete ui;
}

View file

@ -35,7 +35,7 @@ private:
void copyUrl(); void copyUrl();
QString getLink(const QString &permaLink); QString getLink(const QString &permaLink);
Ui::RedditWidget *ui; QScopedPointer<Ui::RedditWidget> ui;
RedditModel* const m_model; RedditModel* const m_model;
QMenu *m_contextMenu; QMenu *m_contextMenu;
}; };

View file

@ -300,6 +300,4 @@ QStandardItemModel *XMRigWidget::model() {
return m_model; return m_model;
} }
XMRigWidget::~XMRigWidget() { XMRigWidget::~XMRigWidget() = default;
delete ui;
}

View file

@ -51,7 +51,7 @@ signals:
private: private:
void showContextMenu(const QPoint &pos); void showContextMenu(const QPoint &pos);
Ui::XMRigWidget *ui; QScopedPointer<Ui::XMRigWidget> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
XmRig * m_XMRig; XmRig * m_XMRig;
QStandardItemModel *m_model; QStandardItemModel *m_model;