From 6e55c84d188f10916fb9693a04d396f3565ce47a Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 19 Feb 2024 17:00:47 +0800 Subject: [PATCH] Instantiate and hook up FileProviderFastEnumerationSettings within FileProviderSettings Signed-off-by: Claudio Cambra --- src/gui/macOS/ui/FileProviderSettings.qml | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/gui/macOS/ui/FileProviderSettings.qml b/src/gui/macOS/ui/FileProviderSettings.qml index f3844f245..c9fc2f23c 100644 --- a/src/gui/macOS/ui/FileProviderSettings.qml +++ b/src/gui/macOS/ui/FileProviderSettings.qml @@ -60,6 +60,8 @@ Page { padding: Style.standardSpacing ColumnLayout { + id: rootColumn + anchors { top: parent.top left: parent.left @@ -100,6 +102,39 @@ Page { syncStatus: root.controller.domainSyncStatusForAccount(root.accountUserIdAtHost) } + FileProviderFastEnumerationSettings { + id: fastEnumerationSettings + + Layout.fillWidth: true + + fastEnumerationSet: root.controller.fastEnumerationSetForAccount(root.accountUserIdAtHost) + fastEnumerationEnabled: root.controller.fastEnumerationEnabledForAccount(root.accountUserIdAtHost) + onFastEnumerationEnabledToggled: root.controller.setFastEnumerationEnabledForAccount(root.accountUserIdAtHost, enabled) + + padding: 0 + + Connections { + target: root.controller + + function updateFastEnumerationValues() { + fastEnumerationSettings.fastEnumerationEnabled = root.controller.fastEnumerationEnabledForAccount(root.accountUserIdAtHost); + fastEnumerationSettings.fastEnumerationSet = root.controller.fastEnumerationSetForAccount(root.accountUserIdAtHost); + } + + function onFastEnumerationEnabledForAccountChanged(accountUserIdAtHost) { + if (root.accountUserIdAtHost === accountUserIdAtHost) { + updateFastEnumerationValues(); + } + } + + function onFastEnumerationSetForAccountChanged(accountUserIdAtHost) { + if (root.accountUserIdAtHost === accountUserIdAtHost) { + updateFastEnumerationValues(); + } + } + } + } + FileProviderStorageInfo { id: storageInfo localUsedStorage: root.controller.localStorageUsageGbForAccount(root.accountUserIdAtHost) -- 2.30.2