From fa824ac78a113097140fdc6db4eac4bcac44dffc Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 24 Oct 2023 17:07:07 +0200 Subject: [PATCH] Async load on timelines/calls history bt keep sync only on first elements. --- .../Linphone/Timeline/CallTimeline.qml | 26 +++++++++-------- .../ui/modules/Linphone/Timeline/Timeline.qml | 28 +++++++++++-------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/linphone-app/ui/modules/Linphone/Timeline/CallTimeline.qml b/linphone-app/ui/modules/Linphone/Timeline/CallTimeline.qml index d1e92f530..6db4ad03b 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/CallTimeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/CallTimeline.qml @@ -122,19 +122,23 @@ ColumnLayout{ | (outgoingFilter.checked ? CallHistoryProxyModel.Outgoing : 0) | (missedFilter.checked ? CallHistoryProxyModel.Missed : 0) } - - delegate: CallTimelineItem{ - callHistoryModel: $modelData - modelIndex: index - Connections{ - target: $modelData - onSelectedChanged:{ - if(selected) { - view.currentIndex = index; - mainItem.entrySelected(model) + delegate: Loader{ + width: view.contentWidth + asynchronous: index > 20 + active: true + sourceComponent: CallTimelineItem{ + callHistoryModel: $modelData + modelIndex: index + Connections{ + target: $modelData + onSelectedChanged:{ + if(selected) { + view.currentIndex = index; + mainItem.entrySelected(model) + } } } } } } -} \ No newline at end of file +} diff --git a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml index 566ea0988..bb4c3d81c 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml @@ -149,18 +149,22 @@ Rectangle { filterFlags: (secureFilter.checked ? TimelineProxyModel.SecureChatRoom : 0) | (chatGroupFilter.checked ? TimelineProxyModel.GroupChatRoom : 0) } - - delegate: TimelineItem{ - timelineModel: $modelData - modelIndex: index - optionsTogglable: timeline.optionsTogglable - actions: timeline.actions - - Connections{ - target: $modelData - onSelectedChanged:{ - if(selected) { - view.currentIndex = index; + delegate: Loader{ + width: view.contentWidth + asynchronous: index > 20 + active: true + sourceComponent: TimelineItem{ + timelineModel: $modelData + modelIndex: index + optionsTogglable: timeline.optionsTogglable + actions: timeline.actions + + Connections{ + target: $modelData + onSelectedChanged:{ + if(selected) { + view.currentIndex = index; + } } } }