From 44a3a90517b17a75b54636d3390bb3cf83568e45 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 17 Dec 2025 15:17:32 +0100 Subject: [PATCH] wait for core to be started before initializing lists --- Linphone/core/App.cpp | 39 +++++++++++++++++++++-------------- Linphone/data/languages/de.ts | 34 +++++++++++++++--------------- Linphone/data/languages/en.ts | 34 +++++++++++++++--------------- Linphone/data/languages/fr.ts | 34 +++++++++++++++--------------- 4 files changed, 74 insertions(+), 67 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 90d81914..a5fa076c 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -620,23 +620,30 @@ void App::initCore() { mNotifier = new Notifier(mEngine); mEngine->setObjectOwnership(settings.get(), QQmlEngine::CppOwnership); mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); - if (!mAccountList) setAccountList(AccountList::create()); - else { - mAccountList->setInitialized(false); - mAccountList->lUpdate(true); - } - // Update global unread Notifications when an account updates his unread Notifications - connect(mAccountList.get(), &AccountList::unreadNotificationsChanged, this, [this]() { - lDebug() << "unreadNotificationsChanged of AccountList"; - mCoreModelConnection->invokeToModel([this] { - int n = mEventCountNotifier->getCurrentEventCount(); - mCoreModelConnection->invokeToCore([this, n] { mEventCountNotifier->notifyEventCount(n); }); - }); + + connect(this, &App::coreStartedChanged, this, [this] { + if (mCoreStarted) { + if (!mAccountList) setAccountList(AccountList::create()); + else { + mAccountList->setInitialized(false); + mAccountList->lUpdate(true); + } + // Update global unread Notifications when an account updates his unread Notifications + connect(mAccountList.get(), &AccountList::unreadNotificationsChanged, this, [this]() { + lDebug() << "unreadNotificationsChanged of AccountList"; + mCoreModelConnection->invokeToModel([this] { + int n = mEventCountNotifier->getCurrentEventCount(); + mCoreModelConnection->invokeToCore( + [this, n] { mEventCountNotifier->notifyEventCount(n); }); + }); + }); + if (!mCallList) setCallList(CallList::create()); + else mCallList->lUpdate(); + if (!mChatList) setChatList(ChatList::create()); + else mChatList->lUpdate(); + disconnect(this, &App::coreStartedChanged, this, nullptr); + } }); - if (!mCallList) setCallList(CallList::create()); - else mCallList->lUpdate(); - if (!mChatList) setChatList(ChatList::create()); - else mChatList->lUpdate(); if (!mSettings) { mSettings = settings; diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 4fee98ea..2380e4df 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 diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index dbaecdc3..466b021a 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 diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index b7fdca90..6f9cea0c 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