mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix call history list sorting #LINQT-2346
This commit is contained in:
parent
f039784b26
commit
7f1708dacb
3 changed files with 9 additions and 18 deletions
|
|
@ -70,7 +70,7 @@ void CallHistoryList::setSelf(QSharedPointer<CallHistoryList> me) {
|
|||
for (auto it : linphoneCallLogs) {
|
||||
auto model = createCallHistoryCore(it);
|
||||
toConnect(model.get());
|
||||
callLogs->push_back(model);
|
||||
callLogs->push_front(model);
|
||||
}
|
||||
mModelConnection->invokeToCore([this, callLogs]() {
|
||||
mustBeInMainThread(getClassName());
|
||||
|
|
|
|||
|
|
@ -68,8 +68,5 @@ bool CallHistoryProxy::SortFilterList::filterAcceptsRow(int sourceRow, const QMo
|
|||
}
|
||||
|
||||
bool CallHistoryProxy::SortFilterList::lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const {
|
||||
auto l = getItemAtSource<CallHistoryList, CallHistoryCore>(sourceLeft.row());
|
||||
auto r = getItemAtSource<CallHistoryList, CallHistoryCore>(sourceRight.row());
|
||||
if (l && r) return l->mDate < r->mDate;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ ListView {
|
|||
|
||||
onResultsReceived: {
|
||||
loading = false
|
||||
// contentY = 0
|
||||
}
|
||||
|
||||
model: CallHistoryProxy {
|
||||
|
|
@ -49,13 +48,12 @@ ListView {
|
|||
|
||||
Component.onCompleted: cacheBuffer = Math.max(mainItem.height,0) //contentHeight>0 ? contentHeight : 0// cache all items
|
||||
// remove binding loop
|
||||
onContentHeightChanged: Qt.callLater(function () {
|
||||
if (mainItem)
|
||||
mainItem.cacheBuffer = Math?.max(contentHeight, 0) || 0
|
||||
})
|
||||
// onContentHeightChanged: Qt.callLater(function () {
|
||||
// if (mainItem)
|
||||
// mainItem.cacheBuffer = Math?.max(contentHeight, 0) || 0
|
||||
// })
|
||||
|
||||
onActiveFocusChanged: if (activeFocus && currentIndex < 0 && count > 0)
|
||||
currentIndex = 0
|
||||
onActiveFocusChanged: if (activeFocus && currentIndex < 0 && count > 0) currentIndex = 0
|
||||
onCountChanged: {
|
||||
if (currentIndex < 0 && count > 0) {
|
||||
mainItem.currentIndex = 0 // Select first item after loading model
|
||||
|
|
@ -86,8 +84,8 @@ ListView {
|
|||
// Update position only if we are moving to current item and its position is changing.
|
||||
property var _currentItemY: currentItem?.y
|
||||
on_CurrentItemYChanged: if (_currentItemY && moveAnimation.running) {
|
||||
moveToCurrentItem()
|
||||
}
|
||||
moveToCurrentItem()
|
||||
}
|
||||
Behavior on contentY {
|
||||
NumberAnimation {
|
||||
id: moveAnimation
|
||||
|
|
@ -98,10 +96,6 @@ ListView {
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
onVisibleChanged: {
|
||||
// if (!visible)
|
||||
// currentIndex = -1
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
anchors.horizontalCenter: mainItem.horizontalCenter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue