Instantiate and hook up FileProviderFastEnumerationSettings within FileProviderSettings

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-19 17:00:47 +08:00
parent 23ef72c472
commit 6e55c84d18

View file

@ -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)