UpdateDialog: fix updater connect

This commit is contained in:
tobtoht 2023-02-12 03:32:47 +01:00
parent 31183f7a31
commit 0881c287ba
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
2 changed files with 5 additions and 5 deletions

View file

@ -26,6 +26,10 @@ UpdateDialog::UpdateDialog(QWidget *parent, QSharedPointer<Updater> 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> 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();
}

View file

@ -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;
}