From 00ce50ece515224b2f8cc1be709b689d4d403d3f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 28 Sep 2023 19:59:45 +0800 Subject: [PATCH] Store materialised file metadata in file provider settings controller Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovidersettingscontroller_mac.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/macOS/fileprovidersettingscontroller_mac.mm b/src/gui/macOS/fileprovidersettingscontroller_mac.mm index 0459085e1db87..77348fc14ea82 100644 --- a/src/gui/macOS/fileprovidersettingscontroller_mac.mm +++ b/src/gui/macOS/fileprovidersettingscontroller_mac.mm @@ -207,16 +207,21 @@ void fetchMaterialisedFilesStorageUsage() } const NSUInteger usage = storageUseObserver.usage; + NSSet> *const items = storageUseObserver.materialisedItems; // Remember that OCC::Account::userIdAtHost == domain.identifier for us NSMutableDictionary *const mutableStorageDictCopy = _storageUsage.mutableCopy; + NSMutableDictionary> *> *const mutableFilesDictCopy = _materialisedFiles.mutableCopy; qCDebug(lcFileProviderSettingsController) << "Local storage use for" << domain.identifier << usage; [mutableStorageDictCopy setObject:@(usage) forKey:domain.identifier]; + [mutableFilesDictCopy setObject:items forKey:domain.identifier]; + _storageUsage = mutableStorageDictCopy.copy; + _materialisedFiles = mutableFilesDictCopy.copy; const auto qDomainIdentifier = QString::fromNSString(domain.identifier); emit q->localStorageUsageForAccountChanged(qDomainIdentifier); @@ -252,6 +257,7 @@ void initialCheck() NSUserDefaults *_userDefaults = NSUserDefaults.standardUserDefaults; NSString *_accountsKey = [NSString stringWithUTF8String:enabledAccountsSettingsKey]; NSDictionary *_storageUsage = @{}; + NSDictionary > *> *_materialisedFiles = @{}; }; FileProviderSettingsController *FileProviderSettingsController::instance()