瀏覽代碼

clear code

Marino Faggiana 7 年之前
父節點
當前提交
df1e5c092c

+ 0 - 27
PickerFileProvider/FileProviderEnumeratorFile.swift

@@ -34,7 +34,6 @@ class FileProviderEnumeratorFile: NSObject, NSFileProviderEnumerator {
     }
     
     func invalidate() {
-        // TODO: perform invalidation of server connection if necessary
     }
     
     func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
@@ -56,32 +55,6 @@ class FileProviderEnumeratorFile: NSObject, NSFileProviderEnumerator {
         
         observer.didEnumerate(items)
         observer.finishEnumerating(upTo: nil)
-    
-
-        /* TODO:
-         - inspect the page to determine whether this is an initial or a follow-up request
-         
-         If this is an enumerator for a directory, the root container or all directories:
-         - perform a server request to fetch directory contents
-         If this is an enumerator for the active set:
-         - perform a server request to update your local database
-         - fetch the active set from your local database
-         
-         - inform the observer about the items returned by the server (possibly multiple times)
-         - inform the observer that you are finished with this page
-         */
-    }
-    
-    func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
-        /* TODO:
-         - query the server for updates since the passed-in sync anchor
-         
-         If this is an enumerator for the active set:
-         - note the changes in your local database
-         
-         - inform the observer about item deletions and updates (modifications + insertions)
-         - inform the observer when you have finished enumerating up to a subsequent sync anchor
-         */
     }
 }
 

+ 0 - 26
PickerFileProvider/FileProviderEnumeratorWorkingSet.swift

@@ -33,22 +33,9 @@ class FileProviderEnumeratorWorkingSet: NSObject, NSFileProviderEnumerator {
     }
     
     func invalidate() {
-        // TODO: perform invalidation of server connection if necessary
     }
     
     func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
-        /* TODO:
-         - inspect the page to determine whether this is an initial or a follow-up request
-         
-         If this is an enumerator for a directory, the root container or all directories:
-         - perform a server request to fetch directory contents
-         If this is an enumerator for the active set:
-         - perform a server request to update your local database
-         - fetch the active set from your local database
-         
-         - inform the observer about the items returned by the server (possibly multiple times)
-         - inform the observer that you are finished with this page
-         */
         
         var items: [NSFileProviderItemProtocol] = []
         
@@ -70,17 +57,4 @@ class FileProviderEnumeratorWorkingSet: NSObject, NSFileProviderEnumerator {
         observer.didEnumerate(items)
         observer.finishEnumerating(upTo: nil)
     }
-    
-    func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
-        /* TODO:
-         - query the server for updates since the passed-in sync anchor
-         
-         If this is an enumerator for the active set:
-         - note the changes in your local database
-         
-         - inform the observer about item deletions and updates (modifications + insertions)
-         - inform the observer when you have finished enumerating up to a subsequent sync anchor
-         */
-    }
-    
 }