From d57bb585dbbad9c73a5ab8d4c737ad44920cd178 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 5 Jan 2026 12:20:20 +0100 Subject: [PATCH] Fixes: Only show config error when restarting, not everytime the app starts send conferenceInfoReceived when conf info state is New Use App ChatList instead of a new one in each ChatProxy (try to fix crash when catching signals in ChatCore) --- Linphone/core/App.cpp | 10 +-- Linphone/core/chat/ChatProxy.cpp | 4 +- Linphone/core/chat/ChatProxy.hpp | 3 +- .../core/conference/ConferenceInfoCore.cpp | 11 ++- Linphone/core/proxy/SortFilterProxy.cpp | 2 +- Linphone/data/languages/de.ts | 86 +++++++++---------- Linphone/data/languages/en.ts | 86 +++++++++---------- Linphone/data/languages/fr.ts | 86 +++++++++---------- .../Control/Display/Chat/ChatListView.qml | 1 + Linphone/view/Page/Main/Chat/ChatPage.qml | 1 - 10 files changed, 143 insertions(+), 147 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index d044f1246..318ebc74b 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -115,7 +115,6 @@ #include "tool/thread/Thread.hpp" #include "tool/ui/DashRectangle.hpp" - #if defined(Q_OS_MACOS) #include "core/event-count-notifier/EventCountNotifierMacOs.hpp" #else @@ -395,7 +394,7 @@ void App::setSelf(QSharedPointer(me)) { &CoreModel::configuringStatus, [this](const std::shared_ptr &core, linphone::ConfiguringState status, const std::string &message) { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); - if (status == linphone::ConfiguringState::Failed) { + if (mIsRestarting && status == linphone::ConfiguringState::Failed) { mCoreModelConnection->invokeToCore([this, message]() { mustBeInMainThread(log().arg(Q_FUNC_INFO)); //: Error @@ -851,7 +850,6 @@ void App::initCppInterfaces() { qmlRegisterType(Constants::MainQmlUri, 1, 0, "CallHistoryProxy"); qmlRegisterType(Constants::MainQmlUri, 1, 0, "CallGui"); qmlRegisterType(Constants::MainQmlUri, 1, 0, "CallProxy"); - qmlRegisterType(Constants::MainQmlUri, 1, 0, "ChatList"); qmlRegisterType(Constants::MainQmlUri, 1, 0, "ChatProxy"); qmlRegisterType(Constants::MainQmlUri, 1, 0, "ChatGui"); qmlRegisterType(Constants::MainQmlUri, 1, 0, "EventLogGui"); @@ -974,13 +972,13 @@ void App::restart() { CoreModel::getInstance()->getCore()->stop(); mCoreModelConnection->invokeToCore([this]() { mIsRestarting = true; - closeCallsWindow(); - setMainWindow(nullptr); - setCoreStarted(false); if (mAccountList) mAccountList->resetData(); if (mCallList) mCallList->resetData(); if (mChatList) mChatList->resetData(); if (mConferenceInfoList) mConferenceInfoList->resetData(); + closeCallsWindow(); + setMainWindow(nullptr); + setCoreStarted(false); mEngine->clearComponentCache(); mEngine->clearSingletons(); delete mEngine; diff --git a/Linphone/core/chat/ChatProxy.cpp b/Linphone/core/chat/ChatProxy.cpp index 6f4eed9da..cd01ee842 100644 --- a/Linphone/core/chat/ChatProxy.cpp +++ b/Linphone/core/chat/ChatProxy.cpp @@ -26,9 +26,6 @@ DEFINE_ABSTRACT_OBJECT(ChatProxy) ChatProxy::ChatProxy(QObject *parent) { - mList = ChatList::create(); - setSourceModel(mList.get()); - setDynamicSortFilter(true); } ChatProxy::~ChatProxy() { @@ -55,6 +52,7 @@ void ChatProxy::setSourceModel(QAbstractItemModel *model) { } QSortFilterProxyModel::setSourceModel(newChatList); sort(0); + emit modelChanged(); } int ChatProxy::findChatIndex(ChatGui *chatGui) { diff --git a/Linphone/core/chat/ChatProxy.hpp b/Linphone/core/chat/ChatProxy.hpp index 7a11debd0..2356ccfa2 100644 --- a/Linphone/core/chat/ChatProxy.hpp +++ b/Linphone/core/chat/ChatProxy.hpp @@ -30,7 +30,7 @@ class ChatProxy : public SortFilterProxy, public AbstractObject { Q_OBJECT - Q_PROPERTY(QAbstractItemModel *model WRITE setSourceModel ) + Q_PROPERTY(QAbstractItemModel *model WRITE setSourceModel NOTIFY modelChanged) public: ChatProxy(QObject *parent = Q_NULLPTR); @@ -45,6 +45,7 @@ public: signals: void chatAdded(ChatGui *chat); + void modelChanged(); protected: QSharedPointer mList; diff --git a/Linphone/core/conference/ConferenceInfoCore.cpp b/Linphone/core/conference/ConferenceInfoCore.cpp index 9c8fd2a29..c04b98e8b 100644 --- a/Linphone/core/conference/ConferenceInfoCore.cpp +++ b/Linphone/core/conference/ConferenceInfoCore.cpp @@ -192,15 +192,14 @@ void ConferenceInfoCore::setSelf(QSharedPointer me) { mConfInfoModelConnection->makeConnectToModel( &ConferenceInfoModel::schedulerStateChanged, [this](linphone::ConferenceScheduler::State state) { auto confInfoState = mConferenceInfoModel->getState(); - QString uri; if (state == linphone::ConferenceScheduler::State::Ready) { - uri = mConferenceInfoModel->getConferenceScheduler()->getUri(); - emit CoreModel::getInstance()->conferenceInfoReceived( - CoreModel::getInstance()->getCore(), mConferenceInfoModel->getConferenceInfo()); + if (confInfoState == linphone::ConferenceInfo::State::New) { + emit CoreModel::getInstance()->conferenceInfoReceived( + CoreModel::getInstance()->getCore(), mConferenceInfoModel->getConferenceInfo()); + } } mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state), - infoState = LinphoneEnums::fromLinphone(confInfoState), - uri] { + infoState = LinphoneEnums::fromLinphone(confInfoState)] { setConferenceSchedulerState(state); setConferenceInfoState(infoState); }); diff --git a/Linphone/core/proxy/SortFilterProxy.cpp b/Linphone/core/proxy/SortFilterProxy.cpp index 887aad0d6..5e34337a4 100644 --- a/Linphone/core/proxy/SortFilterProxy.cpp +++ b/Linphone/core/proxy/SortFilterProxy.cpp @@ -57,7 +57,7 @@ int SortFilterProxy::getCount() const { QVariant SortFilterProxy::getAt(const int &atIndex) const { auto modelIndex = index(atIndex, 0); - return sourceModel()->data(mapToSource(modelIndex), 0); + return sourceModel() ? sourceModel()->data(mapToSource(modelIndex), 0) : QVariant(); } int SortFilterProxy::getFilterType() const { diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 9952bee98..5ef0a1876 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -674,141 +674,141 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? Möchten Sie die Remote-Konfiguration von dieser Adresse herunterladen und anwenden? - - - + + + info_popup_error_title Error Fehler - - + + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote-Provisionierung fehlgeschlagen: %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. Fehler bei der Update-Prüfung. Bitte später erneut versuchen oder Support-Team kontaktieren. - + info_popup_new_version_download_label Herunterladen! - + info_popup_new_version_available_title New version available ! Neue Version verfügbar! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 Eine neue Version von Linphone (%1) ist unter %1 verfügbar - + info_popup_version_up_to_date_title Auf dem neuesten Stand - + info_popup_version_up_to_date_message Your version is up to date 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 @@ -2125,65 +2125,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 schreibt… - + chat_message_draft_sending_text Entwurf: %1 - + chat_room_delete "Delete" Löschen - + chat_room_mute Stummschalten - + chat_room_unmute "Mute" Stummschaltung aufheben - + chat_room_mark_as_read "Mark as read" Als gelesen markieren - + chat_room_leave "leave" Verlassen - + chat_list_leave_chat_popup_title leave the conversation ? Chat verlassen? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? „Sie können in diesem Chat keine Nachrichten mehr senden oder empfangen. Möchten Sie fortfahren? - + chat_list_delete_chat_popup_title Delete the conversation ? Chat löschen? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? Dieser Chat und alle seine Nachrichten werden gelöscht. Möchten Sie fortfahren? @@ -2716,13 +2716,13 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! ConferenceInfoCore - + information_popup_error_title "Erreur" Fehler - + information_popup_disconnected_account_message "Votre compte est déconnecté" Ihr Konto ist getrennt @@ -3402,18 +3402,18 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! ContactsSettingsProviderLayout - + information_popup_success_title Erfolg - + information_popup_changes_saved "Les changements ont été sauvegardés" Änderungen wurden gespeichert - + add "Ajouter" Hinzufügen diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 25239a1d9..7149dd4ce 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -655,141 +655,141 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? Do you want to download and apply remote provisioning from this address ? - - - + + + info_popup_error_title Error Error - - + + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote provisioning failed : %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. An error occured while trying to check update. Please try again later or contact support team. - + info_popup_new_version_download_label Download it ! - + info_popup_new_version_available_title New version available ! New version available ! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 A new version of Linphone (%1) is available at %1 - + info_popup_version_up_to_date_title Up to date - + info_popup_version_up_to_date_message Your version is up to date 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 @@ -2088,65 +2088,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 is writing… - + chat_message_draft_sending_text Draft : %1 - + chat_room_delete "Delete" Delete - + chat_room_mute Mute - + chat_room_unmute "Mute" Unmute - + chat_room_mark_as_read "Mark as read" Mark as read - + chat_room_leave "leave" Leave - + chat_list_leave_chat_popup_title leave the conversation ? Leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? This conversation and all its messages will be deleted. Do You want to continue ? @@ -2669,13 +2669,13 @@ Only your correspondent can decrypt them. ConferenceInfoCore - + information_popup_error_title "Erreur" Error - + information_popup_disconnected_account_message "Votre compte est déconnecté" Your account is disconnected @@ -3310,18 +3310,18 @@ Only your correspondent can decrypt them. ContactsSettingsProviderLayout - + information_popup_success_title Success - + information_popup_changes_saved "Les changements ont été sauvegardés" Changes have been saved - + add "Ajouter" Add diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index d2f971af3..3a30494cf 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -650,141 +650,141 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? - - - + + + info_popup_error_title Error Erreur - - + + info_popup_configuration_failed_message Remote provisioning failed : %1 La configuration distante a échoué : %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. Une erreur est survenue lors de la recherche de mise à jour. Merci de réessayer plus tard ou de contacter l'équipe de support. - + info_popup_new_version_download_label Téléchargez-là ! - + info_popup_new_version_available_title New version available ! Nouvelle version disponible ! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 Une nouvelle version de Linphone (%1) est disponible. %2 - + info_popup_version_up_to_date_title À jour - + info_popup_version_up_to_date_message Your version is up to date 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 @@ -2083,65 +2083,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… - + chat_message_draft_sending_text Brouillon : %1 - + chat_room_delete "Delete" Supprimer - + chat_room_mute Mettre en sourdine - + chat_room_unmute "Mute" Enlever la sourdine - + chat_room_mark_as_read "Mark as read" Marquer comme lu - + chat_room_leave "leave" Quitter la conversation - + chat_list_leave_chat_popup_title leave the conversation ? Quitter la conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ? - + chat_list_delete_chat_popup_title Delete the conversation ? Supprimer la conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ? @@ -2664,13 +2664,13 @@ en bout. Seul votre correspondant peut les déchiffrer. ConferenceInfoCore - + information_popup_error_title "Erreur" Erreur - + information_popup_disconnected_account_message "Votre compte est déconnecté" Votre compte est déconnecté @@ -3305,18 +3305,18 @@ en bout. Seul votre correspondant peut les déchiffrer. ContactsSettingsProviderLayout - + information_popup_success_title Succès - + information_popup_changes_saved "Les changements ont été sauvegardés" Les changements ont été sauvegardés - + add "Ajouter" Ajouter diff --git a/Linphone/view/Control/Display/Chat/ChatListView.qml b/Linphone/view/Control/Display/Chat/ChatListView.qml index c54f965da..75d3dfba2 100644 --- a/Linphone/view/Control/Display/Chat/ChatListView.qml +++ b/Linphone/view/Control/Display/Chat/ChatListView.qml @@ -40,6 +40,7 @@ ListView { model: ChatProxy { id: chatProxy filterText: mainItem.searchText + model: AppCpp.chats onFilterTextChanged: { chatToSelectLater = currentChatGui } diff --git a/Linphone/view/Page/Main/Chat/ChatPage.qml b/Linphone/view/Page/Main/Chat/ChatPage.qml index 560b7526c..9132e61c5 100644 --- a/Linphone/view/Page/Main/Chat/ChatPage.qml +++ b/Linphone/view/Page/Main/Chat/ChatPage.qml @@ -214,7 +214,6 @@ AbstractMainPage { Layout.fillHeight: true Layout.topMargin: Utils.getSizeWithScreenRatio(39) searchBar: searchBar - chatProxy.sourceModel: AppCpp.chats Control.ScrollBar.vertical: scrollbar onCurrentChatGuiChanged: {