From: tobtoht Date: Wed, 29 Mar 2023 09:00:41 +0000 (+0200) Subject: refactor: misc cleanup X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=32fa222c8d3049508e1a437b84a10ab83369a890;p=gamesguru%2Ffeather.git refactor: misc cleanup --- diff --git a/src/CalcWidget.cpp b/src/CalcWidget.cpp index dc6e7b1b..8bc554e1 100644 --- a/src/CalcWidget.cpp +++ b/src/CalcWidget.cpp @@ -10,7 +10,6 @@ #include "utils/AppData.h" #include "utils/ColorScheme.h" #include "utils/config.h" -#include "utils/WebsocketClient.h" #include "utils/WebsocketNotifier.h" CalcWidget::CalcWidget(QWidget *parent) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index b2e5f2c7..7572b8c6 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -8,7 +8,6 @@ #include #include -#include "config-feather.h" #include "constants.h" #include "dialog/BalanceDialog.h" #include "dialog/DebugInfoDialog.h" @@ -30,8 +29,6 @@ #include "utils/AsyncTask.h" #include "utils/ColorScheme.h" #include "utils/Icons.h" -#include "utils/NetworkManager.h" -#include "utils/os/tails.h" #include "utils/SemanticVersion.h" #include "utils/TorManager.h" #include "utils/Updater.h" @@ -1026,11 +1023,6 @@ void MainWindow::showHistoryTab() { ui->tabWidget->setCurrentIndex(Tabs::HISTORY); } -void MainWindow::showSendTab() { - this->raise(); - ui->tabWidget->setCurrentIndex(Tabs::SEND); -} - void MainWindow::fillSendTab(const QString &address, const QString &description) { m_sendWidget->fill(address, description); ui->tabWidget->setCurrentIndex(Tabs::SEND); @@ -1498,7 +1490,7 @@ void MainWindow::onSelectedInputsChanged(const QStringList &selectedInputs) { } } -void MainWindow::onExportHistoryCSV(bool checked) { +void MainWindow::onExportHistoryCSV() { if (m_wallet == nullptr) return; QString fn = QFileDialog::getSaveFileName(this, "Save CSV file", QDir::homePath(), "CSV (*.csv)"); @@ -1510,7 +1502,7 @@ void MainWindow::onExportHistoryCSV(bool checked) { QMessageBox::information(this, "CSV export", QString("Transaction history exported to %1").arg(fn)); } -void MainWindow::onExportContactsCSV(bool checked) { +void MainWindow::onExportContactsCSV() { if (m_wallet == nullptr) return; auto *model = m_wallet->addressBookModel(); if (model->rowCount() <= 0){ @@ -1521,13 +1513,13 @@ void MainWindow::onExportContactsCSV(bool checked) { const QString targetDir = QFileDialog::getExistingDirectory(this, "Select CSV output directory ", QDir::homePath(), QFileDialog::ShowDirsOnly); if(targetDir.isEmpty()) return; - qint64 now = QDateTime::currentDateTime().currentMSecsSinceEpoch(); + qint64 now = QDateTime::currentMSecsSinceEpoch(); QString fn = QString("%1/monero-contacts_%2.csv").arg(targetDir, QString::number(now / 1000)); if(model->writeCSV(fn)) QMessageBox::information(this, "Address book exported", QString("Address book exported to %1").arg(fn)); } -void MainWindow::onCreateDesktopEntry(bool checked) { +void MainWindow::onCreateDesktopEntry() { auto msg = Utils::xdgDesktopEntryRegister() ? "Desktop entry created" : "Desktop entry not created due to an error."; QMessageBox::information(this, "Desktop entry", msg); } @@ -1536,7 +1528,7 @@ void MainWindow::onShowDocumentation() { Utils::externalLinkWarning(this, "https://docs.featherwallet.org"); } -void MainWindow::onReportBug(bool checked) { +void MainWindow::onReportBug() { Utils::externalLinkWarning(this, "https://docs.featherwallet.org/guides/report-an-issue"); } @@ -1745,4 +1737,4 @@ void MainWindow::toggleSearchbar(bool visible) { MainWindow::~MainWindow() { qDebug() << "~MainWindow"; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/MainWindow.h b/src/MainWindow.h index 6bcc5364..ca51f86d 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -126,11 +126,11 @@ private slots: void menuProxySettingsClicked(); void menuToggleTabVisible(const QString &key); void menuClearHistoryClicked(); - void onExportHistoryCSV(bool checked); - void onExportContactsCSV(bool checked); - void onCreateDesktopEntry(bool checked); + void onExportHistoryCSV(); + void onExportContactsCSV(); + void onCreateDesktopEntry(); void onShowDocumentation(); - void onReportBug(bool checked); + void onReportBug(); void onShowSettingsPage(int page); // offline tx signing @@ -172,7 +172,6 @@ private slots: void donateButtonClicked(); void showCalcWindow(); void payToMany(); - void showSendTab(); void showHistoryTab(); void showSendScreen(const CCSEntry &entry); void skinChanged(const QString &skinName); diff --git a/src/ReceiveWidget.h b/src/ReceiveWidget.h index aefed1af..7b329e5b 100644 --- a/src/ReceiveWidget.h +++ b/src/ReceiveWidget.h @@ -56,10 +56,9 @@ private: Wallet *m_wallet; QMenu *m_headerMenu; QAction *m_showFullAddressesAction; - QAction *m_showUsedAddressesAction; QAction *m_showTransactionsAction; - SubaddressModel * m_model; - SubaddressProxyModel * m_proxyModel; + SubaddressModel *m_model; + SubaddressProxyModel *m_proxyModel; void updateQrCode(); void showQrCodeDialog(); diff --git a/src/SendWidget.cpp b/src/SendWidget.cpp index 08bb5334..432ca1fa 100644 --- a/src/SendWidget.cpp +++ b/src/SendWidget.cpp @@ -67,8 +67,11 @@ SendWidget::SendWidget(Wallet *wallet, QWidget *parent) } void SendWidget::currencyComboChanged(int index) { + Q_UNUSED(index) QString amount = ui->lineAmount->text(); - if(amount.isEmpty()) return; + if (amount.isEmpty()) { + return; + } this->amountEdited(amount); } @@ -91,6 +94,7 @@ void SendWidget::addressEdited() { } void SendWidget::amountEdited(const QString &text) { + Q_UNUSED(text) this->updateConversionLabel(); } diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index 1e8f6df1..ade768e1 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -556,15 +556,6 @@ QString barrayToString(const QByteArray &data) { return QString::fromUtf8(data); } -QString getAccountName() { - QString accountName = qgetenv("USER"); // mac/linux - if (accountName.isEmpty()) - accountName = qgetenv("USERNAME"); // Windows - if (accountName.isEmpty()) - throw std::runtime_error("Could derive system account name from env vars: USER or USERNAME"); - return accountName; -} - QFont getMonospaceFont() { if (QFontInfo(QApplication::font()).fixedPitch()) { diff --git a/src/utils/Utils.h b/src/utils/Utils.h index 24590ac5..de381c50 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -67,7 +67,6 @@ namespace Utils void applicationLogHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); QString barrayToString(const QByteArray &data); - QString getAccountName(); bool isLocalUrl(const QUrl &url);