reset current chat when switching account (fix #LINQT-1971)

This commit is contained in:
Gaelle Braud 2025-09-03 11:38:20 +02:00
parent d3d352948b
commit d5841e45ec
7 changed files with 59 additions and 47 deletions

View file

@ -417,7 +417,10 @@ void App::setSelf(QSharedPointer<App>(me)) {
}); });
mCoreModelConnection->makeConnectToModel(&CoreModel::defaultAccountChanged, [this] { mCoreModelConnection->makeConnectToModel(&CoreModel::defaultAccountChanged, [this] {
int n = mEventCountNotifier->getCurrentEventCount(); int n = mEventCountNotifier->getCurrentEventCount();
mCoreModelConnection->invokeToCore([this, n] { mEventCountNotifier->notifyEventCount(n); }); mCoreModelConnection->invokeToCore([this, n] {
mEventCountNotifier->notifyEventCount(n);
emit defaultAccountChanged();
});
}); });
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------

View file

@ -182,6 +182,7 @@ signals:
void mainWindowChanged(); void mainWindowChanged();
void coreStartedChanged(bool coreStarted); void coreStartedChanged(bool coreStarted);
void accountsChanged(); void accountsChanged();
void defaultAccountChanged();
void callsChanged(); void callsChanged();
void currentDateChanged(); void currentDateChanged();
// void executeCommand(QString command); // void executeCommand(QString command);

View file

@ -44,7 +44,7 @@ ChatGui *ParticipantInfoProxy::getChat() const {
} }
void ParticipantInfoProxy::setChat(ChatGui *chat) { void ParticipantInfoProxy::setChat(ChatGui *chat) {
lDebug() << "[ParticipantInfoProxy] set current chat " << this << " => " << chat; lDebug() << "[ParticipantInfoProxy] set current chat " << chat;
if (mChat != chat) { if (mChat != chat) {
mChat = chat; mChat = chat;
mParticipants->setChatCore(chat ? chat->mCore : nullptr); mParticipants->setChatCore(chat ? chat->mCore : nullptr);

View file

@ -530,87 +530,87 @@
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="386"/> <location filename="../../core/App.cpp" line="386"/>
<location filename="../../core/App.cpp" line="636"/> <location filename="../../core/App.cpp" line="639"/>
<source>info_popup_error_title</source> <source>info_popup_error_title</source>
<extracomment>Error</extracomment> <extracomment>Error</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="387"/> <location filename="../../core/App.cpp" line="387"/>
<location filename="../../core/App.cpp" line="638"/> <location filename="../../core/App.cpp" line="641"/>
<source>info_popup_configuration_failed_message</source> <source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment> <extracomment>Remote provisioning failed : %1</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="632"/> <location filename="../../core/App.cpp" line="635"/>
<source>configuration_error_detail</source> <source>configuration_error_detail</source>
<extracomment>not reachable</extracomment> <extracomment>not reachable</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="891"/> <location filename="../../core/App.cpp" line="894"/>
<source>application_description</source> <source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment> <extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation> <translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="893"/> <location filename="../../core/App.cpp" line="896"/>
<source>command_line_arg_order</source> <source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment> <extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Kommandozeilen-Befehl an die Anwendung schicken</translation> <translation>Kommandozeilen-Befehl an die Anwendung schicken</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="897"/> <location filename="../../core/App.cpp" line="900"/>
<source>command_line_option_show_help</source> <source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation> <translation>Zeige Hilfe</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="902"/> <location filename="../../core/App.cpp" line="905"/>
<source>command_line_option_show_app_version</source> <source>command_line_option_show_app_version</source>
<translation type="unfinished">Zeige App-Version</translation> <translation type="unfinished">Zeige App-Version</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="910"/> <location filename="../../core/App.cpp" line="913"/>
<source>command_line_option_config_to_fetch</source> <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> <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> <translation>Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="912"/> <location filename="../../core/App.cpp" line="915"/>
<source>command_line_option_config_to_fetch_arg</source> <source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment> <extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, Pfad oder Datei</translation> <translation>URL, Pfad oder Datei</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="917"/> <location filename="../../core/App.cpp" line="920"/>
<source>command_line_option_minimized</source> <source>command_line_option_minimized</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="920"/> <location filename="../../core/App.cpp" line="923"/>
<source>command_line_option_log_to_stdout</source> <source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation> <translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="923"/> <location filename="../../core/App.cpp" line="926"/>
<source>command_line_option_print_app_logs_only</source> <source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment> <extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation> <translation>Nur Anwendungs-Logs ausgeben</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>hide_action</source> <source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment> <extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation> <translation>Ausblenden</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>show_action</source> <source>show_action</source>
<translation>Zeigen</translation> <translation>Zeigen</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1308"/> <location filename="../../core/App.cpp" line="1311"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation> <translation>Beenden</translation>

View file

@ -530,87 +530,87 @@
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="386"/> <location filename="../../core/App.cpp" line="386"/>
<location filename="../../core/App.cpp" line="636"/> <location filename="../../core/App.cpp" line="639"/>
<source>info_popup_error_title</source> <source>info_popup_error_title</source>
<extracomment>Error</extracomment> <extracomment>Error</extracomment>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="387"/> <location filename="../../core/App.cpp" line="387"/>
<location filename="../../core/App.cpp" line="638"/> <location filename="../../core/App.cpp" line="641"/>
<source>info_popup_configuration_failed_message</source> <source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment> <extracomment>Remote provisioning failed : %1</extracomment>
<translation>Remote provisioning failed : %1</translation> <translation>Remote provisioning failed : %1</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="632"/> <location filename="../../core/App.cpp" line="635"/>
<source>configuration_error_detail</source> <source>configuration_error_detail</source>
<extracomment>not reachable</extracomment> <extracomment>not reachable</extracomment>
<translation>not reachable</translation> <translation>not reachable</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="891"/> <location filename="../../core/App.cpp" line="894"/>
<source>application_description</source> <source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment> <extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation> <translation>A free and open source SIP video-phone.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="893"/> <location filename="../../core/App.cpp" line="896"/>
<source>command_line_arg_order</source> <source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment> <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> <translation>Send an order to the application towards a command line</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="897"/> <location filename="../../core/App.cpp" line="900"/>
<source>command_line_option_show_help</source> <source>command_line_option_show_help</source>
<translation>Show this help</translation> <translation>Show this help</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="902"/> <location filename="../../core/App.cpp" line="905"/>
<source>command_line_option_show_app_version</source> <source>command_line_option_show_app_version</source>
<translation>Show app version</translation> <translation>Show app version</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="910"/> <location filename="../../core/App.cpp" line="913"/>
<source>command_line_option_config_to_fetch</source> <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> <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> <translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="912"/> <location filename="../../core/App.cpp" line="915"/>
<source>command_line_option_config_to_fetch_arg</source> <source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment> <extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation> <translation>URL, path or file</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="917"/> <location filename="../../core/App.cpp" line="920"/>
<source>command_line_option_minimized</source> <source>command_line_option_minimized</source>
<translation>Minimize</translation> <translation>Minimize</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="920"/> <location filename="../../core/App.cpp" line="923"/>
<source>command_line_option_log_to_stdout</source> <source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation> <translation>Log to stdout some debug information while running</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="923"/> <location filename="../../core/App.cpp" line="926"/>
<source>command_line_option_print_app_logs_only</source> <source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment> <extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation> <translation>Print only logs from the application</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>hide_action</source> <source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment> <extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Hide</translation> <translation>Hide</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>show_action</source> <source>show_action</source>
<translation>Show</translation> <translation>Show</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1308"/> <location filename="../../core/App.cpp" line="1311"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation> <translation>Quit</translation>

View file

@ -530,87 +530,87 @@
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="386"/> <location filename="../../core/App.cpp" line="386"/>
<location filename="../../core/App.cpp" line="636"/> <location filename="../../core/App.cpp" line="639"/>
<source>info_popup_error_title</source> <source>info_popup_error_title</source>
<extracomment>Error</extracomment> <extracomment>Error</extracomment>
<translation>Erreur</translation> <translation>Erreur</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="387"/> <location filename="../../core/App.cpp" line="387"/>
<location filename="../../core/App.cpp" line="638"/> <location filename="../../core/App.cpp" line="641"/>
<source>info_popup_configuration_failed_message</source> <source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment> <extracomment>Remote provisioning failed : %1</extracomment>
<translation>La configuration distante a échoué : %1</translation> <translation>La configuration distante a échoué : %1</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="632"/> <location filename="../../core/App.cpp" line="635"/>
<source>configuration_error_detail</source> <source>configuration_error_detail</source>
<extracomment>not reachable</extracomment> <extracomment>not reachable</extracomment>
<translation>indisponible</translation> <translation>indisponible</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="891"/> <location filename="../../core/App.cpp" line="894"/>
<source>application_description</source> <source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment> <extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation> <translation>A free and open source SIP video-phone.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="893"/> <location filename="../../core/App.cpp" line="896"/>
<source>command_line_arg_order</source> <source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment> <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> <translation>Send an order to the application towards a command line</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="897"/> <location filename="../../core/App.cpp" line="900"/>
<source>command_line_option_show_help</source> <source>command_line_option_show_help</source>
<translation>Show this help</translation> <translation>Show this help</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="902"/> <location filename="../../core/App.cpp" line="905"/>
<source>command_line_option_show_app_version</source> <source>command_line_option_show_app_version</source>
<translation>Afficher la version de l&apos;application</translation> <translation>Afficher la version de l&apos;application</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="910"/> <location filename="../../core/App.cpp" line="913"/>
<source>command_line_option_config_to_fetch</source> <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> <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> <translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="912"/> <location filename="../../core/App.cpp" line="915"/>
<source>command_line_option_config_to_fetch_arg</source> <source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment> <extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation> <translation>URL, path or file</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="917"/> <location filename="../../core/App.cpp" line="920"/>
<source>command_line_option_minimized</source> <source>command_line_option_minimized</source>
<translation>Minimiser</translation> <translation>Minimiser</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="920"/> <location filename="../../core/App.cpp" line="923"/>
<source>command_line_option_log_to_stdout</source> <source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation> <translation>Log to stdout some debug information while running</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="923"/> <location filename="../../core/App.cpp" line="926"/>
<source>command_line_option_print_app_logs_only</source> <source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment> <extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation> <translation>Print only logs from the application</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>hide_action</source> <source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment> <extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Cacher</translation> <translation>Cacher</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1293"/> <location filename="../../core/App.cpp" line="1296"/>
<source>show_action</source> <source>show_action</source>
<translation>Afficher</translation> <translation>Afficher</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1308"/> <location filename="../../core/App.cpp" line="1311"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation> <translation>Quitter</translation>

View file

@ -346,6 +346,14 @@ AbstractMainPage {
onChatChanged: { onChatChanged: {
if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat
} }
// Reset current chat when switching account, otherwise the binding makes
// the last chat from last account the current chat for the new default account
Connections {
target: AppCpp
function onDefaultAccountChanged() {
selectedChatView.chat = null
}
}
// Binding is destroyed when forward message is done so // Binding is destroyed when forward message is done so
// we need this connection in addition // we need this connection in addition
Connections { Connections {