зеркало из https://github.com/nextcloud/desktop.git
Implement NSFileProviderServicing in FileProviderExtension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
6f5b07c1ae
Коммит
5ed456f30c
|
@ -18,7 +18,23 @@ import NCDesktopClientSocketKit
|
|||
import NextcloudKit
|
||||
import OSLog
|
||||
|
||||
extension FileProviderExtension {
|
||||
extension FileProviderExtension: NSFileProviderServicing {
|
||||
func supportedServiceSources(
|
||||
for itemIdentifier: NSFileProviderItemIdentifier,
|
||||
completionHandler: @escaping ([NSFileProviderServiceSource]?, Error?) -> Void
|
||||
) -> Progress {
|
||||
Logger.desktopClientConnection.debug("Serving supported service sources")
|
||||
let clientCommService = ClientCommunicationService(fpExtension: self)
|
||||
let services = [clientCommService]
|
||||
completionHandler(services, nil)
|
||||
let progress = Progress()
|
||||
progress.cancellationHandler = {
|
||||
let error = NSError(domain: NSCocoaErrorDomain, code: NSUserCancelledError)
|
||||
completionHandler(nil, error)
|
||||
}
|
||||
return progress
|
||||
}
|
||||
|
||||
@objc func sendFileProviderDomainIdentifier() {
|
||||
let command = "FILE_PROVIDER_DOMAIN_IDENTIFIER_REQUEST_REPLY"
|
||||
let argument = domain.identifier.rawValue
|
||||
|
|
Загрузка…
Ссылка в новой задаче