var outstandingSessionTasks: [String: URLSessionTask] = [:]
var outstandingOcIdTemp: [String: String] = [:]
- private var itemIdsForEnumeratorsNeedingSignalling: NSMutableSet = NSMutableSet()
-
required init(domain: NSFileProviderDomain) {
self.domain = domain
// The containing application must create a domain using `NSFileProviderManager.add(_:, completionHandler:)`. The system will then launch the application extension process, call `FileProviderExtension.init(domain:)` to instantiate the extension for that domain, and call methods on the instance.
func invalidate() {
// TODO: cleanup any resources
+ NSLog("Extension for domain %@ is being torn down", domain.displayName)
}
// MARK: NSFileProviderReplicatedExtension protocol methods
}
let dbManager = NextcloudFilesDatabaseManager.shared
+
guard let metadata = dbManager.itemMetadataFromFileProviderItemIdentifier(identifier),
let parentItemIdentifier = parentItemIdentifierFromMetadata(metadata) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
guard let ncAccount = ncAccount else {
NSLog("Not providing enumerator for container with identifier %@ yet as account not set up", containerItemIdentifier.rawValue)
- itemIdsForEnumeratorsNeedingSignalling.add(containerItemIdentifier)
throw NSFileProviderError(.notAuthenticated)
}
}
}
- itemIdsForEnumeratorsNeedingSignalling = NSMutableSet()
return
}
NSLog("Signalling enumerators for user %@ at server %@", ncAccount!.username, ncAccount!.serverUrl)
- for itemId in itemIdsForEnumeratorsNeedingSignalling {
- fpManager.signalEnumerator(for: itemId as! NSFileProviderItemIdentifier) { error in
- if error != nil {
- NSLog("Error signalling enumerator for root container, received error: %@", error!.localizedDescription)
- }
+ fpManager.signalEnumerator(for: .workingSet) { error in
+ if error != nil {
+ NSLog("Error signalling enumerator for working set, received error: %@", error!.localizedDescription)
}
}
-
- itemIdsForEnumeratorsNeedingSignalling = NSMutableSet()
}
func setupDomainAccount(user: String, serverUrl: String, password: String) {