do not display message that no update is avvailable if the check was done in the background

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-06-28 14:11:27 +03:00
parent 5928bc30e1
commit 2c02d02214
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 8 additions and 2 deletions

View File

@ -85,6 +85,11 @@ PrismExternalUpdater::~PrismExternalUpdater()
}
void PrismExternalUpdater::checkForUpdates()
{
checkForUpdates(true);
}
void PrismExternalUpdater::checkForUpdates(bool triggeredByUser)
{
QProgressDialog progress(tr("Checking for updates..."), "", 0, 0, priv->parent);
progress.setCancelButton(nullptr);
@ -160,7 +165,7 @@ void PrismExternalUpdater::checkForUpdates()
switch (exit_code) {
case 0:
// no update available
{
if (triggeredByUser) {
qDebug() << "No update available";
auto msgBox = QMessageBox(QMessageBox::Information, tr("No Update Available"), tr("You are running the latest version."),
QMessageBox::Ok, priv->parent);
@ -288,7 +293,7 @@ void PrismExternalUpdater::disconnectTimer()
void PrismExternalUpdater::autoCheckTimerFired()
{
qDebug() << "Auto update Timer fired";
checkForUpdates();
checkForUpdates(false);
}
void PrismExternalUpdater::offerUpdate(const QString& version_name, const QString& version_tag, const QString& release_notes)

View File

@ -41,6 +41,7 @@ class PrismExternalUpdater : public ExternalUpdater {
* Check for updates manually, showing the user a progress bar and an alert if no updates are found.
*/
void checkForUpdates() override;
void checkForUpdates(bool triggeredByUser);
/*!
* Indicates whether or not to check for updates automatically.