зеркало из https://github.com/nextcloud/desktop.git
Add share fetching routine to FPUIExtensionService
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
af93122445
Коммит
6dad778498
|
@ -5,12 +5,13 @@
|
|||
// Created by Claudio Cambra on 21/2/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import FileProvider
|
||||
import NextcloudKit
|
||||
|
||||
let fpUiExtensionServiceName = NSFileProviderServiceName(
|
||||
"com.nextcloud.desktopclient.FPUIExtensionService"
|
||||
)
|
||||
|
||||
@objc protocol FPUIExtensionService {
|
||||
|
||||
func shares(forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier) async -> [NKShare]?
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import FileProvider
|
||||
import Foundation
|
||||
import NextcloudKit
|
||||
import OSLog
|
||||
|
||||
class FPUIExtensionServiceSource: NSObject, NSFileProviderServiceSource, NSXPCListenerDelegate, FPUIExtensionService {
|
||||
|
@ -38,4 +39,12 @@ class FPUIExtensionServiceSource: NSObject, NSFileProviderServiceSource, NSXPCLi
|
|||
|
||||
//MARK: - FPUIExtensionService protocol methods
|
||||
|
||||
func shares(
|
||||
forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier
|
||||
) async -> [NKShare]? {
|
||||
let controller = ItemSharesController(
|
||||
itemIdentifier: itemIdentifier, parentExtension: fpExtension
|
||||
)
|
||||
return await controller.fetch()
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче