diff --git a/src/gui/Pages/AccountSettings/DeviceSection.qml b/src/gui/Pages/AccountSettings/DeviceSection.qml index 908ca2aa..4ba77009 100644 --- a/src/gui/Pages/AccountSettings/DeviceSection.qml +++ b/src/gui/Pages/AccountSettings/DeviceSection.qml @@ -31,8 +31,8 @@ HRowLayout { tristate: true checkState: - sectionTotalCount === sectionCheckedCount ? Qt.Checked : ! sectionCheckedCount ? Qt.Unchecked : + sectionTotalCount === sectionCheckedCount ? Qt.Checked : Qt.PartiallyChecked nextCheckState: diff --git a/src/gui/Pages/AccountSettings/Sessions.qml b/src/gui/Pages/AccountSettings/Sessions.qml index bb0501dd..99198d57 100644 --- a/src/gui/Pages/AccountSettings/Sessions.qml +++ b/src/gui/Pages/AccountSettings/Sessions.qml @@ -25,7 +25,8 @@ HColumnPage { for (const device of devices) deviceList.model.append(device) - loadFuture = null + loadFuture = null + deviceList.sectionItemCounts = getSectionItemCounts() }) } @@ -39,6 +40,17 @@ HColumnPage { }) } + function getSectionItemCounts() { + const counts = {} + + for (let i = 0; i < deviceList.model.count; i++) { + const section = deviceList.model.get(i).type + section in counts ? counts[section] += 1 : counts[section] = 1 + } + + return counts + } + footer: ButtonLayout { visible: height >= 0 @@ -61,17 +73,7 @@ HColumnPage { HListView { id: deviceList - readonly property var sectionItemCounts: { - const counts = {} - - for (let i = 0; i < count; i++) { - const section = model.get(i).type - section in counts ? counts[section] += 1 : counts[section] = 1 - } - - print( "rec") - return counts - } + property var sectionItemCounts: getSectionItemCounts() clip: true model: ListModel {}