Store call history list in app

This commit is contained in:
Gaelle Braud 2026-01-13 16:45:09 +01:00
parent 4a0cdc7f1a
commit e3a1493ceb
7 changed files with 68 additions and 48 deletions

View file

@ -972,6 +972,7 @@ void App::restart() {
mIsRestarting = true; mIsRestarting = true;
if (mAccountList) mAccountList->resetData(); if (mAccountList) mAccountList->resetData();
if (mCallList) mCallList->resetData(); if (mCallList) mCallList->resetData();
if (mCallHistoryList) mCallHistoryList->resetData();
if (mChatList) mChatList->resetData(); if (mChatList) mChatList->resetData();
if (mConferenceInfoList) mConferenceInfoList->resetData(); if (mConferenceInfoList) mConferenceInfoList->resetData();
closeCallsWindow(); closeCallsWindow();
@ -1234,6 +1235,16 @@ void App::setConferenceInfoList(QSharedPointer<ConferenceInfoList> data) {
} }
} }
QSharedPointer<CallHistoryList> App::getCallHistoryList() const {
return mCallHistoryList;
}
void App::setCallHistoryList(QSharedPointer<CallHistoryList> data) {
if (mCallHistoryList != data) {
mCallHistoryList = data;
emit callHistoryChanged();
}
}
QSharedPointer<ChatList> App::getChatList() const { QSharedPointer<ChatList> App::getChatList() const {
return mChatList; return mChatList;
} }

View file

@ -24,6 +24,7 @@
#include <QSharedPointer> #include <QSharedPointer>
#include "core/account/AccountProxy.hpp" #include "core/account/AccountProxy.hpp"
#include "core/call-history/CallHistoryList.hpp"
#include "core/call/CallProxy.hpp" #include "core/call/CallProxy.hpp"
#include "core/chat/ChatGui.hpp" #include "core/chat/ChatGui.hpp"
#include "core/chat/ChatList.hpp" #include "core/chat/ChatList.hpp"
@ -163,6 +164,9 @@ public:
QSharedPointer<ConferenceInfoList> getConferenceInfoList() const; QSharedPointer<ConferenceInfoList> getConferenceInfoList() const;
void setConferenceInfoList(QSharedPointer<ConferenceInfoList> data); void setConferenceInfoList(QSharedPointer<ConferenceInfoList> data);
QSharedPointer<CallHistoryList> getCallHistoryList() const;
void setCallHistoryList(QSharedPointer<CallHistoryList> data);
QSharedPointer<ChatList> getChatList() const; QSharedPointer<ChatList> getChatList() const;
ChatList *getChats() const; ChatList *getChats() const;
void setChatList(QSharedPointer<ChatList> data); void setChatList(QSharedPointer<ChatList> data);
@ -213,6 +217,7 @@ signals:
void currentChatChanged(); void currentChatChanged();
void conferenceInfosChanged(); void conferenceInfosChanged();
void chatsChanged(); void chatsChanged();
void callHistoryChanged();
void localeChanged(); void localeChanged();
// void executeCommand(QString command); // void executeCommand(QString command);
@ -239,6 +244,7 @@ private:
QSharedPointer<ConferenceInfoList> mConferenceInfoList; QSharedPointer<ConferenceInfoList> mConferenceInfoList;
QSharedPointer<ChatList> mChatList; QSharedPointer<ChatList> mChatList;
QSharedPointer<CallList> mCallList; QSharedPointer<CallList> mCallList;
QSharedPointer<CallHistoryList> mCallHistoryList;
QSharedPointer<SafeConnection<App, CoreModel>> mCoreModelConnection; QSharedPointer<SafeConnection<App, CoreModel>> mCoreModelConnection;
QSharedPointer<SafeConnection<App, CliModel>> mCliModelConnection; QSharedPointer<SafeConnection<App, CliModel>> mCliModelConnection;
bool mAutoStart = false; bool mAutoStart = false;

View file

@ -27,6 +27,11 @@ DEFINE_ABSTRACT_OBJECT(CallHistoryProxy)
CallHistoryProxy::CallHistoryProxy(QObject *parent) : LimitProxy(parent) { CallHistoryProxy::CallHistoryProxy(QObject *parent) : LimitProxy(parent) {
mHistoryList = CallHistoryList::create(); mHistoryList = CallHistoryList::create();
if (!App::getInstance()->getCallHistoryList()) {
mHistoryList = CallHistoryList::create();
App::getInstance()->setCallHistoryList(mHistoryList);
}
mHistoryList = App::getInstance()->getCallHistoryList();
connect(mHistoryList.get(), &CallHistoryList::listAboutToBeReset, this, &CallHistoryProxy::listAboutToBeReset); connect(mHistoryList.get(), &CallHistoryList::listAboutToBeReset, this, &CallHistoryProxy::listAboutToBeReset);
setSourceModels(new SortFilterList(mHistoryList.get(), Qt::DescendingOrder)); setSourceModels(new SortFilterList(mHistoryList.get(), Qt::DescendingOrder));
connect(App::getInstance(), &App::currentDateChanged, this, [this] { emit mHistoryList->lUpdate(); }); connect(App::getInstance(), &App::currentDateChanged, this, [this] { emit mHistoryList->lUpdate(); });

View file

@ -735,80 +735,80 @@
<translation>nicht erreichbar</translation> <translation>nicht erreichbar</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1001"/> <location filename="../../core/App.cpp" line="1002"/>
<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="1003"/> <location filename="../../core/App.cpp" line="1004"/>
<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="1007"/> <location filename="../../core/App.cpp" line="1008"/>
<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="1012"/> <location filename="../../core/App.cpp" line="1013"/>
<source>command_line_option_show_app_version</source> <source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation> <translation>App-Version anzeigen</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1020"/> <location filename="../../core/App.cpp" line="1021"/>
<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="1022"/> <location filename="../../core/App.cpp" line="1023"/>
<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="1027"/> <location filename="../../core/App.cpp" line="1028"/>
<source>command_line_option_minimized</source> <source>command_line_option_minimized</source>
<translation>Minimieren</translation> <translation>Minimieren</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1030"/> <location filename="../../core/App.cpp" line="1031"/>
<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="1033"/> <location filename="../../core/App.cpp" line="1034"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<source>show_action</source> <source>show_action</source>
<translation>Zeigen</translation> <translation>Zeigen</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1494"/> <location filename="../../core/App.cpp" line="1505"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation> <translation>Beenden</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1512"/> <location filename="../../core/App.cpp" line="1523"/>
<source>check_for_update</source> <source>check_for_update</source>
<extracomment>Check for update</extracomment> <extracomment>Check for update</extracomment>
<translation>Auf Updates prüfen</translation> <translation>Auf Updates prüfen</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1635"/> <location filename="../../core/App.cpp" line="1646"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation>Alle als gelesen markieren</translation> <translation>Alle als gelesen markieren</translation>
</message> </message>
@ -1026,7 +1026,7 @@
<context> <context>
<name>CallHistoryListView</name> <name>CallHistoryListView</name>
<message> <message>
<location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="206"/> <location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="204"/>
<source>call_name_accessible_button</source> <source>call_name_accessible_button</source>
<extracomment>Call %1</extracomment> <extracomment>Call %1</extracomment>
<translation>Anruf %1</translation> <translation>Anruf %1</translation>

View file

@ -716,80 +716,80 @@
<translation>not reachable</translation> <translation>not reachable</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1001"/> <location filename="../../core/App.cpp" line="1002"/>
<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="1003"/> <location filename="../../core/App.cpp" line="1004"/>
<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="1007"/> <location filename="../../core/App.cpp" line="1008"/>
<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="1012"/> <location filename="../../core/App.cpp" line="1013"/>
<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="1020"/> <location filename="../../core/App.cpp" line="1021"/>
<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="1022"/> <location filename="../../core/App.cpp" line="1023"/>
<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="1027"/> <location filename="../../core/App.cpp" line="1028"/>
<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="1030"/> <location filename="../../core/App.cpp" line="1031"/>
<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="1033"/> <location filename="../../core/App.cpp" line="1034"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<source>show_action</source> <source>show_action</source>
<translation>Show</translation> <translation>Show</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1494"/> <location filename="../../core/App.cpp" line="1505"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation> <translation>Quit</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1512"/> <location filename="../../core/App.cpp" line="1523"/>
<source>check_for_update</source> <source>check_for_update</source>
<extracomment>Check for update</extracomment> <extracomment>Check for update</extracomment>
<translation>Check for update</translation> <translation>Check for update</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1635"/> <location filename="../../core/App.cpp" line="1646"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation> <translation>Marquer tout comme lu</translation>
</message> </message>
@ -1007,7 +1007,7 @@
<context> <context>
<name>CallHistoryListView</name> <name>CallHistoryListView</name>
<message> <message>
<location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="206"/> <location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="204"/>
<source>call_name_accessible_button</source> <source>call_name_accessible_button</source>
<extracomment>Call %1</extracomment> <extracomment>Call %1</extracomment>
<translation>Call %1</translation> <translation>Call %1</translation>

View file

@ -711,80 +711,80 @@
<translation>indisponible</translation> <translation>indisponible</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1001"/> <location filename="../../core/App.cpp" line="1002"/>
<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="1003"/> <location filename="../../core/App.cpp" line="1004"/>
<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="1007"/> <location filename="../../core/App.cpp" line="1008"/>
<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="1012"/> <location filename="../../core/App.cpp" line="1013"/>
<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="1020"/> <location filename="../../core/App.cpp" line="1021"/>
<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="1022"/> <location filename="../../core/App.cpp" line="1023"/>
<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="1027"/> <location filename="../../core/App.cpp" line="1028"/>
<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="1030"/> <location filename="../../core/App.cpp" line="1031"/>
<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="1033"/> <location filename="../../core/App.cpp" line="1034"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<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="1479"/> <location filename="../../core/App.cpp" line="1490"/>
<source>show_action</source> <source>show_action</source>
<translation>Afficher</translation> <translation>Afficher</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1494"/> <location filename="../../core/App.cpp" line="1505"/>
<source>quit_action</source> <source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment> <extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation> <translation>Quitter</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1512"/> <location filename="../../core/App.cpp" line="1523"/>
<source>check_for_update</source> <source>check_for_update</source>
<extracomment>Check for update</extracomment> <extracomment>Check for update</extracomment>
<translation>Rechercher une mise à jour</translation> <translation>Rechercher une mise à jour</translation>
</message> </message>
<message> <message>
<location filename="../../core/App.cpp" line="1635"/> <location filename="../../core/App.cpp" line="1646"/>
<source>mark_all_read_action</source> <source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation> <translation>Marquer tout comme lu</translation>
</message> </message>
@ -982,7 +982,7 @@
<context> <context>
<name>CallHistoryListView</name> <name>CallHistoryListView</name>
<message> <message>
<location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="206"/> <location filename="../../view/Control/Display/Call/CallHistoryListView.qml" line="204"/>
<source>call_name_accessible_button</source> <source>call_name_accessible_button</source>
<extracomment>Call %1</extracomment> <extracomment>Call %1</extracomment>
<translation>Appeler %1</translation> <translation>Appeler %1</translation>

View file

@ -26,14 +26,12 @@ ListView {
model: CallHistoryProxy { model: CallHistoryProxy {
id: callHistoryProxy id: callHistoryProxy
Component.onCompleted: {
loading = true
}
onListAboutToBeReset: loading = true onListAboutToBeReset: loading = true
filterText: mainItem.searchText filterText: mainItem.searchText
onFilterTextChanged: maxDisplayItems = initialDisplayItems onFilterTextChanged: maxDisplayItems = initialDisplayItems
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(56))) initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(56)))
displayItemsStep: 3 * initialDisplayItems / 2 displayItemsStep: 3 * initialDisplayItems / 2
onModelAboutToBeReset: loading = true
onModelReset: { onModelReset: {
mainItem.resultsReceived() mainItem.resultsReceived()
} }