update download folder after settings created #LINQT-2402

This commit is contained in:
Gaelle Braud 2026-02-04 16:35:40 +01:00
parent 158f640731
commit b2e859de06
6 changed files with 71 additions and 64 deletions

View file

@ -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");

View file

@ -682,14 +682,14 @@
<message>
<location filename="../../core/App.cpp" line="425"/>
<location filename="../../core/App.cpp" line="503"/>
<location filename="../../core/App.cpp" line="789"/>
<location filename="../../core/App.cpp" line="791"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Fehler</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="426"/>
<location filename="../../core/App.cpp" line="791"/>
<location filename="../../core/App.cpp" line="793"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>Remote-Provisionierung fehlgeschlagen: %1</translation>
@ -729,86 +729,86 @@
<translation>Ihre Version ist auf dem neuesten Stand</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="785"/>
<location filename="../../core/App.cpp" line="787"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>nicht erreichbar</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1076"/>
<location filename="../../core/App.cpp" line="1078"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1078"/>
<location filename="../../core/App.cpp" line="1080"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Kommandozeilen-Befehl an die Anwendung schicken</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1082"/>
<location filename="../../core/App.cpp" line="1084"/>
<source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1087"/>
<location filename="../../core/App.cpp" line="1089"/>
<source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1095"/>
<location filename="../../core/App.cpp" line="1097"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1097"/>
<location filename="../../core/App.cpp" line="1099"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, Pfad oder Datei</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1102"/>
<location filename="../../core/App.cpp" line="1104"/>
<source>command_line_option_minimized</source>
<translation>Minimieren</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1105"/>
<location filename="../../core/App.cpp" line="1107"/>
<source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1108"/>
<location filename="../../core/App.cpp" line="1110"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>show_action</source>
<translation>Zeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1590"/>
<location filename="../../core/App.cpp" line="1592"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1608"/>
<location filename="../../core/App.cpp" line="1610"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Auf Updates prüfen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1731"/>
<location filename="../../core/App.cpp" line="1733"/>
<source>mark_all_read_action</source>
<translation>Alle als gelesen markieren</translation>
</message>
@ -3591,12 +3591,12 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen!</translation>
<context>
<name>CoreModel</name>
<message>
<location filename="../../model/core/CoreModel.cpp" line="215"/>
<location filename="../../model/core/CoreModel.cpp" line="220"/>
<source>info_popup_error_title</source>
<translation>Fehler</translation>
</message>
<message>
<location filename="../../model/core/CoreModel.cpp" line="217"/>
<location filename="../../model/core/CoreModel.cpp" line="222"/>
<source>fetching_config_failed_error_message</source>
<extracomment>&quot;Remote provisioning cannot be retrieved&quot;</extracomment>
<translation>Die externe Bereitstellung kann nicht abgerufen werden</translation>

View file

@ -663,14 +663,14 @@
<message>
<location filename="../../core/App.cpp" line="425"/>
<location filename="../../core/App.cpp" line="503"/>
<location filename="../../core/App.cpp" line="789"/>
<location filename="../../core/App.cpp" line="791"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Error</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="426"/>
<location filename="../../core/App.cpp" line="791"/>
<location filename="../../core/App.cpp" line="793"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>Remote provisioning failed : %1</translation>
@ -710,86 +710,86 @@
<translation>Up to date Your version is up to date</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="785"/>
<location filename="../../core/App.cpp" line="787"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>not reachable</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1076"/>
<location filename="../../core/App.cpp" line="1078"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1078"/>
<location filename="../../core/App.cpp" line="1080"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1082"/>
<location filename="../../core/App.cpp" line="1084"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1087"/>
<location filename="../../core/App.cpp" line="1089"/>
<source>command_line_option_show_app_version</source>
<translation>Show app version</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1095"/>
<location filename="../../core/App.cpp" line="1097"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1097"/>
<location filename="../../core/App.cpp" line="1099"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1102"/>
<location filename="../../core/App.cpp" line="1104"/>
<source>command_line_option_minimized</source>
<translation>Minimize</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1105"/>
<location filename="../../core/App.cpp" line="1107"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1108"/>
<location filename="../../core/App.cpp" line="1110"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Hide</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>show_action</source>
<translation>Show</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1590"/>
<location filename="../../core/App.cpp" line="1592"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1608"/>
<location filename="../../core/App.cpp" line="1610"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Check for update</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1731"/>
<location filename="../../core/App.cpp" line="1733"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>
@ -3494,12 +3494,12 @@ Only your correspondent can decrypt them.</translation>
<context>
<name>CoreModel</name>
<message>
<location filename="../../model/core/CoreModel.cpp" line="215"/>
<location filename="../../model/core/CoreModel.cpp" line="220"/>
<source>info_popup_error_title</source>
<translation>Error</translation>
</message>
<message>
<location filename="../../model/core/CoreModel.cpp" line="217"/>
<location filename="../../model/core/CoreModel.cpp" line="222"/>
<source>fetching_config_failed_error_message</source>
<extracomment>&quot;Remote provisioning cannot be retrieved&quot;</extracomment>
<translation>Remote provisioning cannot be retrieved</translation>

View file

@ -658,14 +658,14 @@
<message>
<location filename="../../core/App.cpp" line="425"/>
<location filename="../../core/App.cpp" line="503"/>
<location filename="../../core/App.cpp" line="789"/>
<location filename="../../core/App.cpp" line="791"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Erreur</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="426"/>
<location filename="../../core/App.cpp" line="791"/>
<location filename="../../core/App.cpp" line="793"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>La configuration distante a échoué : %1</translation>
@ -705,86 +705,86 @@
<translation>Votre version est à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="785"/>
<location filename="../../core/App.cpp" line="787"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>indisponible</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1076"/>
<location filename="../../core/App.cpp" line="1078"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1078"/>
<location filename="../../core/App.cpp" line="1080"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1082"/>
<location filename="../../core/App.cpp" line="1084"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1087"/>
<location filename="../../core/App.cpp" line="1089"/>
<source>command_line_option_show_app_version</source>
<translation>Afficher la version de l&apos;application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1095"/>
<location filename="../../core/App.cpp" line="1097"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1097"/>
<location filename="../../core/App.cpp" line="1099"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1102"/>
<location filename="../../core/App.cpp" line="1104"/>
<source>command_line_option_minimized</source>
<translation>Minimiser</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1105"/>
<location filename="../../core/App.cpp" line="1107"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1108"/>
<location filename="../../core/App.cpp" line="1110"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Cacher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1575"/>
<location filename="../../core/App.cpp" line="1577"/>
<source>show_action</source>
<translation>Afficher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1590"/>
<location filename="../../core/App.cpp" line="1592"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1608"/>
<location filename="../../core/App.cpp" line="1610"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Rechercher une mise à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1731"/>
<location filename="../../core/App.cpp" line="1733"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>
@ -3469,12 +3469,12 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
<context>
<name>CoreModel</name>
<message>
<location filename="../../model/core/CoreModel.cpp" line="215"/>
<location filename="../../model/core/CoreModel.cpp" line="220"/>
<source>info_popup_error_title</source>
<translation>Erreur</translation>
</message>
<message>
<location filename="../../model/core/CoreModel.cpp" line="217"/>
<location filename="../../model/core/CoreModel.cpp" line="222"/>
<source>fetching_config_failed_error_message</source>
<extracomment>&quot;Remote provisioning cannot be retrieved&quot;</extracomment>
<translation>La configuration distante n&apos;a pas pu être récupérée</translation>

View file

@ -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<linphone::Config> 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<linphone::Config> config = mCore->getConfig();
// config->setString("storage", "friends_db_uri", Utils::appStringToCoreString(friendsPath));
// }
std::shared_ptr<linphone::Factory> 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() {

View file

@ -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<CoreModel> gCoreModel;