]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
MainWindow: cleanup updateNetStats
authortobtoht <thotbot@protonmail.com>
Tue, 6 Jul 2021 19:29:12 +0000 (21:29 +0200)
committertobtoht <thotbot@protonmail.com>
Tue, 6 Jul 2021 19:29:12 +0000 (21:29 +0200)
src/MainWindow.cpp

index dd08be1fe5c546a65c562a65b9c7bb58283d432a..110e2be9900352028de6e6801c9e48e5c331118c 100644 (file)
@@ -1187,21 +1187,14 @@ void MainWindow::onDeviceButtonPressed() {
 }
 
 void MainWindow::updateNetStats() {
-    if (m_ctx->wallet == nullptr) {
-        m_statusLabelNetStats->setText("");
+    if (!m_ctx->wallet || m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected
+                       || m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Synchronized)
+    {
+        m_statusLabelNetStats->hide();
         return;
     }
-    if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected) {
-        m_statusLabelNetStats->setText("");
-        return;
-    }
-
-    if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Synchronized) {
-        m_statusLabelNetStats->setText("");
-        return;
-    }
-
 
+    m_statusLabelNetStats->show();
     m_statusLabelNetStats->setText(QString("(D: %1)").arg(Utils::formatBytes(m_ctx->wallet->getBytesReceived())));
 }