From: Claudio Cambra Date: Mon, 20 Mar 2023 15:15:39 +0000 (+0100) Subject: Use specific signalEnumerator method in FileProviderExtension item renaming instead... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~55^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0f578fabdd01fbe14dbdcd7ba308a88eaee4fc61;p=nextcloud-desktop.git Use specific signalEnumerator method in FileProviderExtension item renaming instead of reinventing wheel Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift index 67f27c551..acde41f16 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift @@ -412,14 +412,10 @@ class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension, NKComm // an item metadata the server URL is the parent folder's URL if itemTemplateIsFolder { _ = dbManager.renameDirectoryAndPropagateToChildren(ocId: ocId, newServerUrl: newServerUrlFileName, newFileName: item.filename) - if let fpManager = NSFileProviderManager(for: self.domain) { - fpManager.signalEnumerator(for: .workingSet) { error in - if error != nil { - Logger.fileTransfer.error("Error notifying change in moved directory: \(error)") - } + self.signalEnumerator { error in + if error != nil { + Logger.fileTransfer.error("Error notifying change in moved directory: \(error)") } - } else { - Logger.fileTransfer.warning("Unable to get file provider for domain, will not be able to notify of change in moved directory") } } else { dbManager.renameItemMetadata(ocId: ocId, newServerUrl: parentItemServerUrl, newFileName: item.filename) @@ -617,7 +613,6 @@ class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension, NKComm return } - let dbManager = NextcloudFilesDatabaseManager.shared let materialisedEnumerator = fpManager.enumeratorForMaterializedItems() let materialisedObserver = FileProviderMaterialisedEnumerationObserver(ncKitAccount: ncAccount.ncKitAccount) { _ in completionHandler()