Skip to content

Commit

Permalink
Merge pull request #7401 from nextcloud/bugfix/materialised-storage-c…
Browse files Browse the repository at this point in the history
…alculation-macOS

Fix materialised storage use calculation (macOS VFS)
  • Loading branch information
claucambra authored Nov 5, 2024
2 parents 01da699 + 4f8a83b commit a255c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/macOS/fileprovidersettingscontroller_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,17 @@ void enumerateMaterialisedFilesForDomainManager(NSFileProviderManager * const ma
const auto qDomainIdentifier = QString::fromNSString(domain.identifier);
QVector<FileProviderItemMetadata> qMaterialisedItems;
qMaterialisedItems.reserve(items.count);
unsigned long long storageUsage = 0;
for (const id<NSFileProviderItem> item in items) {
const auto itemMetadata = FileProviderItemMetadata::fromNSFileProviderItem(item, qDomainIdentifier);
const auto storageUsage = _storageUsage.value(qDomainIdentifier) + itemMetadata.documentSize();
storageUsage += itemMetadata.documentSize();
qCDebug(lcFileProviderSettingsController) << "Adding item" << itemMetadata.identifier()
<< "with size" << itemMetadata.documentSize()
<< "to storage usage for account" << qDomainIdentifier
<< "with total size" << storageUsage;
qMaterialisedItems.append(itemMetadata);
_storageUsage.insert(qDomainIdentifier, storageUsage);
}
_storageUsage.insert(qDomainIdentifier, storageUsage);
_materialisedFiles.insert(qDomainIdentifier, qMaterialisedItems);

emit q->localStorageUsageForAccountChanged(qDomainIdentifier);
Expand Down

0 comments on commit a255c1f

Please sign in to comment.