Fix the progress indicator bug I had introduced in working on FeedlyOperation. Make sure FeedlyOperation calls downloadProgress.completeTask(), and make sure that all paths lead there.
This commit is contained in:
parent
ed23d0ec15
commit
a2bcdb1cfd
|
@ -51,6 +51,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate,
|
||||||
override func didCancel() {
|
override func didCancel() {
|
||||||
operationQueue.cancelAllOperations()
|
operationQueue.cancelAllOperations()
|
||||||
addCompletionHandler = nil
|
addCompletionHandler = nil
|
||||||
|
super.didCancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
func feedlyOperation(_ operation: FeedlyOperation, didFailWith error: Error) {
|
func feedlyOperation(_ operation: FeedlyOperation, didFailWith error: Error) {
|
||||||
|
|
|
@ -64,6 +64,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl
|
||||||
override func didCancel() {
|
override func didCancel() {
|
||||||
operationQueue.cancelAllOperations()
|
operationQueue.cancelAllOperations()
|
||||||
addCompletionHandler = nil
|
addCompletionHandler = nil
|
||||||
|
super.didCancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
func feedlySearchOperation(_ operation: FeedlySearchOperation, didGet response: FeedlyFeedsSearchResponse) {
|
func feedlySearchOperation(_ operation: FeedlySearchOperation, didGet response: FeedlyFeedsSearchResponse) {
|
||||||
|
|
|
@ -73,7 +73,7 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation {
|
||||||
// TODO: fix error on below line: "Expression type '()' is ambiguous without more context"
|
// TODO: fix error on below line: "Expression type '()' is ambiguous without more context"
|
||||||
//os_log(.debug, log: log, "Cancelling %{public}@.", self)
|
//os_log(.debug, log: log, "Cancelling %{public}@.", self)
|
||||||
operationQueue.cancelAllOperations()
|
operationQueue.cancelAllOperations()
|
||||||
didFinish()
|
super.didCancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ class FeedlyOperation: MainThreadOperation {
|
||||||
if !isCanceled {
|
if !isCanceled {
|
||||||
operationDelegate?.operationDidComplete(self)
|
operationDelegate?.operationDidComplete(self)
|
||||||
}
|
}
|
||||||
|
downloadProgress?.completeTask()
|
||||||
}
|
}
|
||||||
|
|
||||||
func didFinish(with error: Error) {
|
func didFinish(with error: Error) {
|
||||||
|
@ -56,5 +57,6 @@ class FeedlyOperation: MainThreadOperation {
|
||||||
}
|
}
|
||||||
|
|
||||||
func didCancel() {
|
func didCancel() {
|
||||||
|
didFinish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,6 +138,7 @@ final class FeedlySyncAllOperation: FeedlyOperation {
|
||||||
os_log(.debug, log: log, "Cancelling sync %{public}@", syncUUID.uuidString)
|
os_log(.debug, log: log, "Cancelling sync %{public}@", syncUUID.uuidString)
|
||||||
self.operationQueue.cancelAllOperations()
|
self.operationQueue.cancelAllOperations()
|
||||||
syncCompletionHandler = nil
|
syncCompletionHandler = nil
|
||||||
|
super.didCancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ final class FeedlySyncStreamContentsOperation: FeedlyOperation, FeedlyOperationD
|
||||||
override func didCancel() {
|
override func didCancel() {
|
||||||
os_log(.debug, log: log, "Canceling sync stream contents")
|
os_log(.debug, log: log, "Canceling sync stream contents")
|
||||||
operationQueue.cancelAllOperations()
|
operationQueue.cancelAllOperations()
|
||||||
|
super.didCancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
func enqueueOperations(for continuation: String?) {
|
func enqueueOperations(for continuation: String?) {
|
||||||
|
|
Loading…
Reference in New Issue