From 4911fa8d3b05de7d7e15d17831f55c2f086538d2 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Fri, 21 Nov 2025 14:34:59 +0100 Subject: [PATCH] fix check for update root url #LINQT-2177 --- Linphone/core/App.cpp | 11 +++++------ Linphone/data/languages/de.ts | 2 +- Linphone/data/languages/en.ts | 2 +- Linphone/data/languages/fr.ts | 2 +- Linphone/model/core/CoreModel.cpp | 10 ++++++++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index d2d177288..bed9b4079 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -438,11 +438,10 @@ void App::setSelf(QSharedPointer(me)) { mCoreModelConnection->invokeToCore([this, result, version, url, checkRequestedByUser] { switch (result) { case linphone::VersionUpdateCheckResult::Error: - if (checkRequestedByUser) - Utils::showInformationPopup(tr("info_popup_error_title"), - //: An error occured while trying to check update. Please - //: try again later or contact support team. - tr("info_popup_error_checking_update"), false); + Utils::showInformationPopup(tr("info_popup_error_title"), + //: An error occured while trying to check update. Please + //: try again later or contact support team. + tr("info_popup_error_checking_update"), false); break; case linphone::VersionUpdateCheckResult::NewVersionAvailable: { QString downloadLink = @@ -1398,7 +1397,7 @@ void App::setSysTrayIcon() { //: Check for update if (mSettings->isCheckForUpdateAvailable()) { QAction *checkForUpdateAction = new QAction(tr("check_for_update"), root); - root->connect(checkForUpdateAction, &QAction::triggered, this, [this] { checkForUpdate(); }); + root->connect(checkForUpdateAction, &QAction::triggered, this, [this] { checkForUpdate(true); }); menu->addAction(checkForUpdateAction); } menu->addAction(quitAction); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 3c682aa01..71b18e576 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -788,7 +788,7 @@ - + mark_all_read_action diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 61fe3a30d..7c6dbc717 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -783,7 +783,7 @@ Check for update - + mark_all_read_action Marquer tout comme lu diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 7a9ac2d47..59750f6c4 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -783,7 +783,7 @@ Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index 6ac9f2207..f963839d2 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -374,8 +374,14 @@ void CoreModel::searchInMagicSearch(QString filter, void CoreModel::checkForUpdate(const std::string &applicationVersion, bool requestedByUser) { mCheckVersionRequestedByUser = requestedByUser; - if (SettingsModel::getInstance()->isCheckForUpdateEnabled()) { - CoreModel::getInstance()->getCore()->checkForUpdate(applicationVersion); + auto settingsModel = SettingsModel::getInstance(); + if (settingsModel->isCheckForUpdateEnabled()) { + if (settingsModel->getVersionCheckUrl().isEmpty()) + settingsModel->setVersionCheckUrl(Constants::VersionCheckReleaseUrl); + lInfo() << log().arg("Checking for update for version") << applicationVersion; + getCore()->checkForUpdate(applicationVersion); + } else { + lWarning() << log().arg("Check for update settings is not set"); } }