From b2e859de06a712cb1c0832a801e2df434593c3df Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 4 Feb 2026 16:35:40 +0100 Subject: [PATCH] update download folder after settings created #LINQT-2402 --- Linphone/core/App.cpp | 2 ++ Linphone/data/languages/de.ts | 38 +++++++++++++++---------------- Linphone/data/languages/en.ts | 38 +++++++++++++++---------------- Linphone/data/languages/fr.ts | 38 +++++++++++++++---------------- Linphone/model/core/CoreModel.cpp | 17 +++++++++----- Linphone/model/core/CoreModel.hpp | 2 +- 6 files changed, 71 insertions(+), 64 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index b26ec29a2..6ed204144 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -645,6 +645,8 @@ void App::initCore() { SettingsModel::create(); lDebug() << log().arg("Creating SettingsCore"); settings = SettingsCore::create(); + // Update the download folder if set in the configuration file + CoreModel::getInstance()->setPathsAfterCreation(); lDebug() << log().arg("Checking downloaded codecs updates"); Utils::checkDownloadedCodecsUpdates(); lDebug() << log().arg("Setting Video Codec Priority Policy"); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 6627887e0..b56d14333 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -682,14 +682,14 @@ - + info_popup_error_title Error Fehler - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote-Provisionierung fehlgeschlagen: %1 @@ -729,86 +729,86 @@ Ihre Version ist auf dem neuesten Stand - + configuration_error_detail not reachable nicht erreichbar - + application_description "A free and open source SIP video-phone." Ein kostenloses Open-Source SIP Video-Telefon. - + command_line_arg_order "Send an order to the application towards a command line" Kommandozeilen-Befehl an die Anwendung schicken - + command_line_option_show_help Zeige Hilfe - + command_line_option_show_app_version App-Version anzeigen - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized Minimieren - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden - + check_for_update Check for update Auf Updates prüfen - + mark_all_read_action Alle als gelesen markieren @@ -3591,12 +3591,12 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! CoreModel - + info_popup_error_title Fehler - + fetching_config_failed_error_message "Remote provisioning cannot be retrieved" Die externe Bereitstellung kann nicht abgerufen werden diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 184fc2a85..cc6193ff4 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -663,14 +663,14 @@ - + info_popup_error_title Error Error - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote provisioning failed : %1 @@ -710,86 +710,86 @@ Up to date Your version is up to date - + configuration_error_detail not reachable not reachable - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Show app version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimize - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Hide - + show_action Show - + quit_action "Quitter" Quit - + check_for_update Check for update Check for update - + mark_all_read_action Marquer tout comme lu @@ -3494,12 +3494,12 @@ Only your correspondent can decrypt them. CoreModel - + info_popup_error_title Error - + fetching_config_failed_error_message "Remote provisioning cannot be retrieved" Remote provisioning cannot be retrieved diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 74d3c5b64..51973a0e3 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -658,14 +658,14 @@ - + info_popup_error_title Error Erreur - + info_popup_configuration_failed_message Remote provisioning failed : %1 La configuration distante a échoué : %1 @@ -705,86 +705,86 @@ Votre version est à jour - + configuration_error_detail not reachable indisponible - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Afficher la version de l'application - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimiser - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Cacher - + show_action Afficher - + quit_action "Quitter" Quitter - + check_for_update Check for update Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu @@ -3469,12 +3469,12 @@ en bout. Seul votre correspondant peut les déchiffrer. CoreModel - + info_popup_error_title Erreur - + fetching_config_failed_error_message "Remote provisioning cannot be retrieved" La configuration distante n'a pas pu être récupérée diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index 5e75704d4..41d985119 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -174,12 +174,17 @@ void CoreModel::setPathBeforeCreation() { } void CoreModel::setPathsAfterCreation() { - auto friendsPath = Paths::getFriendsListFilePath(); - if (!friendsPath.isEmpty() && QFileInfo(friendsPath).exists()) { - lInfo() << log().arg("Using old friends database at %1").arg(friendsPath); - std::shared_ptr config = mCore->getConfig(); - config->setString("storage", "friends_db_uri", Utils::appStringToCoreString(friendsPath)); - } + // auto friendsPath = Paths::getFriendsListFilePath(); + // if (!friendsPath.isEmpty() && QFileInfo(friendsPath).exists()) { + // lInfo() << log().arg("Using old friends database at %1").arg(friendsPath); + // std::shared_ptr config = mCore->getConfig(); + // config->setString("storage", "friends_db_uri", Utils::appStringToCoreString(friendsPath)); + // } + std::shared_ptr factory = linphone::Factory::get(); + QString downloadFolder = SettingsModel::getInstance()->getDownloadFolder(); + if (downloadFolder.isEmpty()) downloadFolder = Paths::getDownloadDirPath(); + if (!downloadFolder.endsWith(QDir::separator())) downloadFolder.append(QDir::separator()); + SET_FACTORY_PATH(Download, (downloadFolder)); } void CoreModel::setPathAfterStart() { diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 85eca27c2..742141f51 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -60,6 +60,7 @@ public: void start(); void setConfigPath(QString path); + void setPathsAfterCreation(); void refreshOidcRemainingTime(); @@ -112,7 +113,6 @@ private: bool mCheckVersionRequestedByUser = false; void setPathBeforeCreation(); - void setPathsAfterCreation(); void setPathAfterStart(); static std::shared_ptr gCoreModel;