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;
if (mAccountList) mAccountList->resetData();
if (mCallList) mCallList->resetData();
if (mCallHistoryList) mCallHistoryList->resetData();
if (mChatList) mChatList->resetData();
if (mConferenceInfoList) mConferenceInfoList->resetData();
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 {
return mChatList;
}

View file

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

View file

@ -27,6 +27,11 @@ DEFINE_ABSTRACT_OBJECT(CallHistoryProxy)
CallHistoryProxy::CallHistoryProxy(QObject *parent) : LimitProxy(parent) {
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);
setSourceModels(new SortFilterList(mHistoryList.get(), Qt::DescendingOrder));
connect(App::getInstance(), &App::currentDateChanged, this, [this] { emit mHistoryList->lUpdate(); });

View file

@ -735,80 +735,80 @@
<translation>nicht erreichbar</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1001"/>
<location filename="../../core/App.cpp" line="1002"/>
<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="1003"/>
<location filename="../../core/App.cpp" line="1004"/>
<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="1007"/>
<location filename="../../core/App.cpp" line="1008"/>
<source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1012"/>
<location filename="../../core/App.cpp" line="1013"/>
<source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1020"/>
<location filename="../../core/App.cpp" line="1021"/>
<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="1022"/>
<location filename="../../core/App.cpp" line="1023"/>
<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="1027"/>
<location filename="../../core/App.cpp" line="1028"/>
<source>command_line_option_minimized</source>
<translation>Minimieren</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1030"/>
<location filename="../../core/App.cpp" line="1031"/>
<source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</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>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1479"/>
<location filename="../../core/App.cpp" line="1490"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1479"/>
<location filename="../../core/App.cpp" line="1490"/>
<source>show_action</source>
<translation>Zeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1494"/>
<location filename="../../core/App.cpp" line="1505"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1512"/>
<location filename="../../core/App.cpp" line="1523"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Auf Updates prüfen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1635"/>
<location filename="../../core/App.cpp" line="1646"/>
<source>mark_all_read_action</source>
<translation>Alle als gelesen markieren</translation>
</message>
@ -1026,7 +1026,7 @@
<context>
<name>CallHistoryListView</name>
<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>
<extracomment>Call %1</extracomment>
<translation>Anruf %1</translation>

View file

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

View file

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

View file

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