MainWindow: fix potential segfault

This commit is contained in:
tobtoht 2021-05-24 16:50:09 +02:00
parent 808fd94f2a
commit 58b927f9a3
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
2 changed files with 7 additions and 2 deletions

View file

@ -358,13 +358,13 @@ void MainWindow::initWalletContext() {
connect(m_ctx.get(), &AppContext::customRestoreHeightSet, this, &MainWindow::onCustomRestoreHeightSet);
// Nodes
connect(m_ctx->nodes, &Nodes::updateStatus, [=](const QString &msg){this->setStatusText(msg);});
connect(m_ctx->nodes, &Nodes::updateStatus, this, &MainWindow::onSetStatusText);
connect(m_ctx->nodes, &Nodes::nodeExhausted, this, &MainWindow::showNodeExhaustedMessage);
connect(m_ctx->nodes, &Nodes::WSNodeExhausted, this, &MainWindow::showWSNodeExhaustedMessage);
// Wallet
connect(m_ctx->wallet.get(), &Wallet::connectionStatusChanged, this, &MainWindow::onConnectionStatusChanged);
connect(m_ctx->wallet.get(), &Wallet::currentSubaddressAccountChanged, [this]{this->updateTitle();});
connect(m_ctx->wallet.get(), &Wallet::currentSubaddressAccountChanged, this, &MainWindow::updateTitle);
}
void MainWindow::startupWarning() {
@ -498,6 +498,10 @@ void MainWindow::onBalanceUpdated(quint64 balance, quint64 spendable) {
m_balanceWidget->setHidden(hide);
}
void MainWindow::onSetStatusText(const QString &text) {
this->setStatusText(text);
}
void MainWindow::setStatusText(const QString &text, bool override, int timeout) {
if (override) {
m_statusOverrideActive = true;

View file

@ -175,6 +175,7 @@ private slots:
void menuHwDeviceClicked();
void onUpdatesAvailable(const QJsonObject &updates);
void toggleSearchbar(bool enabled);
void onSetStatusText(const QString &text);
private:
void initStatusBar();