Skip to content

Commit

Permalink
Do not even pretend to handle paging in item enumeration
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Dec 16, 2024
1 parent cea1baa commit e7655a5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,10 @@ public class Enumerator: NSObject, NSFileProviderEnumerator {
}
}

static func fileProviderPageforNumPage(_ numPage: Int) -> NSFileProviderPage {
NSFileProviderPage("\(numPage)".data(using: .utf8)!)
static func fileProviderPageforNumPage(_ numPage: Int) -> NSFileProviderPage? {
return nil
// TODO: Handle paging properly
// NSFileProviderPage("\(numPage)".data(using: .utf8)!)
}

private static func completeEnumerationObserver(
Expand All @@ -638,11 +640,11 @@ public class Enumerator: NSObject, NSFileProviderEnumerator {
// TODO: Handle paging properly
/*
if items.count == maxItemsPerFileProviderPage {
let nextPage = numPage + 1
let providerPage = NSFileProviderPage("\(nextPage)".data(using: .utf8)!)
observer.finishEnumerating(upTo: providerPage)
let nextPage = numPage + 1
let providerPage = NSFileProviderPage("\(nextPage)".data(using: .utf8)!)
observer.finishEnumerating(upTo: providerPage)
} else {
observer.finishEnumerating(upTo: nil)
observer.finishEnumerating(upTo: nil)
}
*/
observer.finishEnumerating(upTo: fileProviderPageforNumPage(numPage))
Expand Down

0 comments on commit e7655a5

Please sign in to comment.