fix check for update root url #LINQT-2177

This commit is contained in:
Gaelle Braud 2025-11-21 14:34:59 +01:00
parent 514c337192
commit bba3edd4b6
5 changed files with 16 additions and 11 deletions

View file

@ -438,11 +438,10 @@ void App::setSelf(QSharedPointer<App>(me)) {
mCoreModelConnection->invokeToCore([this, result, version, url, checkRequestedByUser] { mCoreModelConnection->invokeToCore([this, result, version, url, checkRequestedByUser] {
switch (result) { switch (result) {
case linphone::VersionUpdateCheckResult::Error: case linphone::VersionUpdateCheckResult::Error:
if (checkRequestedByUser) Utils::showInformationPopup(tr("info_popup_error_title"),
Utils::showInformationPopup(tr("info_popup_error_title"), //: An error occured while trying to check update. Please
//: An error occured while trying to check update. Please //: try again later or contact support team.
//: try again later or contact support team. tr("info_popup_error_checking_update"), false);
tr("info_popup_error_checking_update"), false);
break; break;
case linphone::VersionUpdateCheckResult::NewVersionAvailable: { case linphone::VersionUpdateCheckResult::NewVersionAvailable: {
QString downloadLink = QString downloadLink =
@ -1398,7 +1397,7 @@ void App::setSysTrayIcon() {
//: Check for update //: Check for update
if (mSettings->isCheckForUpdateAvailable()) { if (mSettings->isCheckForUpdateAvailable()) {
QAction *checkForUpdateAction = new QAction(tr("check_for_update"), root); 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(checkForUpdateAction);
} }
menu->addAction(quitAction); menu->addAction(quitAction);

View file

@ -788,7 +788,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1518"/> <location filename="../../core/App.cpp" line="1519"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View file

@ -783,7 +783,7 @@
<translation>Check for update</translation> <translation>Check for update</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1518"/> <location filename="../../core/App.cpp" line="1519"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation> <translation>Marquer tout comme lu</translation>
</message> </message>

View file

@ -783,7 +783,7 @@
<translation>Rechercher une mise à jour</translation> <translation>Rechercher une mise à jour</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1518"/> <location filename="../../core/App.cpp" line="1519"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation> <translation>Marquer tout comme lu</translation>
</message> </message>

View file

@ -374,8 +374,14 @@ void CoreModel::searchInMagicSearch(QString filter,
void CoreModel::checkForUpdate(const std::string &applicationVersion, bool requestedByUser) { void CoreModel::checkForUpdate(const std::string &applicationVersion, bool requestedByUser) {
mCheckVersionRequestedByUser = requestedByUser; mCheckVersionRequestedByUser = requestedByUser;
if (SettingsModel::getInstance()->isCheckForUpdateEnabled()) { auto settingsModel = SettingsModel::getInstance();
CoreModel::getInstance()->getCore()->checkForUpdate(applicationVersion); 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");
} }
} }