Skip to content

Commit 2c3ebb2

Browse files
committed
fix(file-provider): Trash enumerates only locally trashed items.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
1 parent 6b0807e commit 2c3ebb2

3 files changed

Lines changed: 17 additions & 16 deletions

File tree

shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,15 @@ import OSLog
139139
}
140140

141141
let progress = Progress()
142+
142143
Task {
143144
progress.totalUnitCount = 1
144-
if let item = await Item.storedItem(
145-
identifier: identifier,
146-
account: ncAccount,
147-
remoteInterface: ncKit,
148-
dbManager: dbManager,
149-
log: log
150-
) {
145+
146+
if let item = await Item.storedItem(identifier: identifier, account: ncAccount, remoteInterface: ncKit, dbManager: dbManager, log: log) {
151147
progress.completedUnitCount = 1
152148
completionHandler(item, nil)
153149
} else {
154-
completionHandler(
155-
nil, NSError.fileProviderErrorForNonExistentItem(withIdentifier: identifier)
156-
)
150+
completionHandler(nil, NSError.fileProviderErrorForNonExistentItem(withIdentifier: identifier))
157151
}
158152
}
159153
return progress

shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gui/macOS/fileproviderdomainmanager_mac.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,13 @@ void addFileProviderDomain(const AccountState * const accountState)
347347
NSFileProviderDomain * const fileProviderDomain = [[NSFileProviderDomain alloc] initWithIdentifier:domainId.toNSString()
348348
displayName:domainDisplayName.toNSString()];
349349

350+
if (@available(macOS 13.0, *)) {
351+
// supportsSyncingTrash is only available on macOS 13 and later.
352+
// The trash is a server feature of which the availability can change any time.
353+
// Its availability is checked on demand by the file provider extension itself.
354+
fileProviderDomain.supportsSyncingTrash = YES;
355+
}
356+
350357
[NSFileProviderManager addDomain:fileProviderDomain completionHandler:^(NSError * const error) {
351358
if(error) {
352359
qCWarning(lcMacFileProviderDomainManager) << "Error adding file provider domain: "

0 commit comments

Comments
 (0)