plasmoid:fix binding loop for Indexer ability

work/spdx
Michail Vourlakos 4 years ago
parent d7ede10d15
commit f1ed353fb9

@ -31,13 +31,15 @@ ClientAbility.Indexer {
readonly property bool tailAppletIsSeparator: isActive ? bridge.indexer.tailAppletIsSeparator : false readonly property bool tailAppletIsSeparator: isActive ? bridge.indexer.tailAppletIsSeparator : false
readonly property bool headAppletIsSeparator: isActive ? bridge.indexer.headAppletIsSeparator : false readonly property bool headAppletIsSeparator: isActive ? bridge.indexer.headAppletIsSeparator : false
property bool updateIsBlocked: false
property int visibleItemsCount: 0 property int visibleItemsCount: 0
property int itemsCount: 0 /*is needed to be set from consumer developer in order to avoid binding loops warnings*/ property int itemsCount: 0 /*is needed to be set from consumer developer in order to avoid binding loops warnings*/
property int firstVisibleItemIndex: -1 property int firstVisibleItemIndex: -1
property int lastVisibleItemIndex: -1 property int lastVisibleItemIndex: -1
readonly property bool isReady: layout && layout.children.length >= itemsCount readonly property bool isReady: (layout && layout.children.length >= itemsCount) && !updateIsBlocked
readonly property int maxIndex: 99999 readonly property int maxIndex: 99999
Binding { Binding {
@ -101,6 +103,24 @@ ClientAbility.Indexer {
} }
} }
Binding {
target: _indexer
property: "separators"
when: isReady
value: {
var seps = [];
for (var i=0; i<layout.children.length; ++i){
var item = layout.children[i];
if (item && item.isSeparator && item.itemIndex>=0) {
seps.push(item.itemIndex);
}
}
return seps;
}
}
readonly property bool firstTailItemIsSeparator: { readonly property bool firstTailItemIsSeparator: {
if (visibleItemsCount === layout.children.length) { if (visibleItemsCount === layout.children.length) {
return false; return false;
@ -131,19 +151,6 @@ ClientAbility.Indexer {
return false; return false;
} }
separators: {
var seps = [];
for (var i=0; i<layout.children.length; ++i){
var item = layout.children[i];
if (item && item.isSeparator && item.itemIndex>=0) {
seps.push(item.itemIndex);
}
}
return seps;
}
hidden: { hidden: {
var hdns = []; var hdns = [];

@ -826,6 +826,7 @@ Item {
bridge: latteBridge bridge: latteBridge
layout: icList.contentItem layout: icList.contentItem
itemsCount: tasksModel.count itemsCount: tasksModel.count
updateIsBlocked: root.inDraggingPhase
} }
Ability.Launchers { Ability.Launchers {

Loading…
Cancel
Save