From: Claudio Cambra Date: Wed, 15 Mar 2023 11:36:48 +0000 (+0100) Subject: Add ability to set handlers from AlamoFire request on Progress extension X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~55^2~78 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=607d72615d90be2b025f3ccae0e1c476b57ee1f8;p=nextcloud-desktop.git Add ability to set handlers from AlamoFire request on Progress extension Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift index 926fed83c..e15e2e0ad 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift @@ -13,8 +13,15 @@ */ import Foundation +import Alamofire extension Progress { + func setHandlersFromAfRequest(_ request: Request) { + self.cancellationHandler = { request.cancel() } + self.pausingHandler = { request.suspend() } + self.resumingHandler = { request.resume() } + } + func copyCurrentStateToProgress(_ otherProgress: Progress, includeHandlers: Bool = false) { if includeHandlers { otherProgress.cancellationHandler = self.cancellationHandler