From 0881c287baf60e222cd0c440c47dadaf4fd08c21 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 12 Feb 2023 03:32:47 +0100 Subject: [PATCH] UpdateDialog: fix updater connect --- src/dialog/UpdateDialog.cpp | 8 ++++---- src/utils/Updater.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dialog/UpdateDialog.cpp b/src/dialog/UpdateDialog.cpp index e35dad7..076c1a5 100644 --- a/src/dialog/UpdateDialog.cpp +++ b/src/dialog/UpdateDialog.cpp @@ -26,6 +26,10 @@ UpdateDialog::UpdateDialog(QWidget *parent, QSharedPointer updater) ui->label_header->setFont(bigFont); ui->frame->hide(); + connect(m_updater.data(), &Updater::updateAvailable, this, &UpdateDialog::updateAvailable); + connect(m_updater.data(), &Updater::noUpdateAvailable, this, &UpdateDialog::noUpdateAvailable); + connect(m_updater.data(), &Updater::updateCheckFailed, this, &UpdateDialog::onUpdateCheckFailed); + bool updateAvailable = (m_updater->state == Updater::State::UPDATE_AVAILABLE); if (updateAvailable) { this->updateAvailable(); @@ -43,10 +47,6 @@ UpdateDialog::UpdateDialog(QWidget *parent, QSharedPointer updater) connect(ui->btn_installUpdate, &QPushButton::clicked, this, &UpdateDialog::onInstallUpdate); connect(ui->btn_restart, &QPushButton::clicked, this, &UpdateDialog::onRestartClicked); - connect(m_updater.data(), &Updater::updateAvailable, this, &UpdateDialog::updateAvailable); - connect(m_updater.data(), &Updater::noUpdateAvailable, this, &UpdateDialog::noUpdateAvailable); - connect(m_updater.data(), &Updater::updateCheckFailed, this, &UpdateDialog::onUpdateCheckFailed); - this->adjustSize(); } diff --git a/src/utils/Updater.cpp b/src/utils/Updater.cpp index faf3732..d76325c 100644 --- a/src/utils/Updater.cpp +++ b/src/utils/Updater.cpp @@ -26,7 +26,7 @@ void Updater::checkForUpdates() { UtilsNetworking network{this}; QNetworkReply *reply = network.getJson(QString("%1/updates.json").arg(this->getWebsiteUrl())); if (!reply) { - emit updateCheckFailed("Can't check for websites: offline mode enabled"); + emit updateCheckFailed("offline mode enabled"); return; }