]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
refactor: misc cleanup
authortobtoht <tob@featherwallet.org>
Wed, 29 Mar 2023 09:00:41 +0000 (11:00 +0200)
committertobtoht <tob@featherwallet.org>
Wed, 29 Mar 2023 09:00:41 +0000 (11:00 +0200)
src/CalcWidget.cpp
src/MainWindow.cpp
src/MainWindow.h
src/ReceiveWidget.h
src/SendWidget.cpp
src/utils/Utils.cpp
src/utils/Utils.h

index dc6e7b1b35da8cfebf1fde9fb3696fdc9020d4d4..8bc554e1e2f9720149ccc18fb237e2056132cfcc 100644 (file)
@@ -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)
index b2e5f2c794e71e06b5569a732709359bc80d2775..7572b8c6711d12ff640d916aa22cd6ced68d3d0b 100644 (file)
@@ -8,7 +8,6 @@
 #include <QInputDialog>
 #include <QMessageBox>
 
-#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
index 6bcc5364c2102706d61f47f1e3c33e8aecc99ff3..ca51f86d88d608386eb32fc2433b57533fbda4a4 100644 (file)
@@ -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);
index aefed1af89d4604373f4d41c1b0742bdf72ab7cc..7b329e5b4b578c0e8fb13a90109446ab72cfa867 100644 (file)
@@ -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();
index 08bb5334ab2f5d3699cb9d252415c42a1d167ab8..432ca1fa7609cb32acc2f22f5f737c1b692a53d4 100644 (file)
@@ -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();
 }
 
index 1e8f6df14c8f7bf3697583105f873e55cb1634fc..ade768e1deb60b69146f0c3b59c450b53115a108 100644 (file)
@@ -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()) {
index 24590ac5f2941bc3a04844d26d8f653cc865875b..de381c50df195c24b4f01d9cc3f20a31dfd0d10d 100644 (file)
@@ -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);