From: Claudio Cambra Date: Mon, 15 Apr 2024 18:47:36 +0000 (+0800) Subject: Remove unused components in FileProviderExt X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~7^2~45^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9bf921873ddd3dc36ce1655328a2a9f894c87581;p=nextcloud-desktop.git Remove unused components in FileProviderExt Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift index 3902ef208..5bcd98c32 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift @@ -22,7 +22,6 @@ extension Logger { static let fpUiExtensionService = Logger(subsystem: subsystem, category: "fpUiExtensionService") static let fileProviderExtension = Logger( subsystem: subsystem, category: "fileproviderextension") - static let fileTransfer = Logger(subsystem: subsystem, category: "filetransfer") static let shares = Logger(subsystem: subsystem, category: "shares") static let logger = Logger(subsystem: subsystem, category: "logger") diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift deleted file mode 100644 index b3c1be803..000000000 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2023 by Claudio Cambra - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -import FileProvider -import Foundation -import NextcloudKit - -extension NKError { - static var noChangesErrorCode: Int { - -200 - } - - var isCouldntConnectError: Bool { - errorCode == -9999 || errorCode == -1001 || errorCode == -1004 || errorCode == -1005 - || errorCode == -1009 || errorCode == -1012 || errorCode == -1200 || errorCode == -1202 - || errorCode == 500 || errorCode == 503 || errorCode == 200 - } - - var isUnauthenticatedError: Bool { - errorCode == -1013 - } - - var isGoingOverQuotaError: Bool { - errorCode == 507 - } - - var isNotFoundError: Bool { - errorCode == 404 - } - - var isNoChangesError: Bool { - errorCode == NKError.noChangesErrorCode - } - - var fileProviderError: NSFileProviderError { - if isNotFoundError { - NSFileProviderError(.noSuchItem) - } else if isCouldntConnectError { - // Provide something the file provider can do something with - NSFileProviderError(.serverUnreachable) - } else if isUnauthenticatedError { - NSFileProviderError(.notAuthenticated) - } else if isGoingOverQuotaError { - NSFileProviderError(.insufficientQuota) - } else { - NSFileProviderError(.cannotSynchronize) - } - } -} diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift deleted file mode 100644 index 630a370dd..000000000 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Progress+Extensions.swift +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2023 by Claudio Cambra - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -import Alamofire -import Foundation - -extension Progress { - func setHandlersFromAfRequest(_ request: Request) { - cancellationHandler = { request.cancel() } - pausingHandler = { request.suspend() } - resumingHandler = { request.resume() } - } - - func copyCurrentStateToProgress(_ otherProgress: Progress, includeHandlers: Bool = false) { - if includeHandlers { - otherProgress.cancellationHandler = cancellationHandler - otherProgress.pausingHandler = pausingHandler - otherProgress.resumingHandler = resumingHandler - } - - otherProgress.totalUnitCount = totalUnitCount - otherProgress.completedUnitCount = completedUnitCount - otherProgress.estimatedTimeRemaining = estimatedTimeRemaining - otherProgress.localizedDescription = localizedAdditionalDescription - otherProgress.localizedAdditionalDescription = localizedAdditionalDescription - otherProgress.isCancellable = isCancellable - otherProgress.isPausable = isPausable - otherProgress.fileCompletedCount = fileCompletedCount - otherProgress.fileURL = fileURL - otherProgress.fileTotalCount = fileTotalCount - otherProgress.fileCompletedCount = fileCompletedCount - otherProgress.fileOperationKind = fileOperationKind - otherProgress.kind = kind - otherProgress.throughput = throughput - - for (key, object) in userInfo { - otherProgress.setUserInfoObject(object, forKey: key) - } - } - - func copyOfCurrentState(includeHandlers: Bool = false) -> Progress { - let newProgress = Progress() - copyCurrentStateToProgress(newProgress, includeHandlers: includeHandlers) - return newProgress - } -} diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj index 0fa332f76..4310f5ab4 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj +++ b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj @@ -11,10 +11,8 @@ 5307A6E82965DAD8001E0C6A /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5307A6E72965DAD8001E0C6A /* NextcloudKit */; }; 5307A6EB2965DB8D001E0C6A /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 5307A6EA2965DB8D001E0C6A /* RealmSwift */; }; 531522822B8E01C6002E31BE /* ShareTableItemView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 531522812B8E01C6002E31BE /* ShareTableItemView.xib */; }; - 5318AD9929BF58D000CBB71C /* NKError+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */; }; 5350E4E92B0C534A00F276CB /* ClientCommunicationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5350E4E82B0C534A00F276CB /* ClientCommunicationService.swift */; }; 5352B36C29DC44B50011CE03 /* FileProviderExtension+Thumbnailing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5352B36B29DC44B50011CE03 /* FileProviderExtension+Thumbnailing.swift */; }; - 5352E85B29B7BFE6002CE85C /* Progress+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */; }; 5358F2B92BAA0F5300E3C729 /* NextcloudCapabilitiesKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5358F2B82BAA0F5300E3C729 /* NextcloudCapabilitiesKit */; }; 535AE30E29C0A2CC0042A9BA /* Logger+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */; }; 53651E442BBC0CA300ECAC29 /* SuggestionsTextFieldKit in Frameworks */ = {isa = PBXBuildFile; productRef = 53651E432BBC0CA300ECAC29 /* SuggestionsTextFieldKit */; }; @@ -151,12 +149,10 @@ /* Begin PBXFileReference section */ 531522812B8E01C6002E31BE /* ShareTableItemView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShareTableItemView.xib; sourceTree = ""; }; - 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NKError+Extensions.swift"; sourceTree = ""; }; 5350E4E72B0C514400F276CB /* ClientCommunicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClientCommunicationProtocol.h; sourceTree = ""; }; 5350E4E82B0C534A00F276CB /* ClientCommunicationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientCommunicationService.swift; sourceTree = ""; }; 5350E4EA2B0C9CE100F276CB /* FileProviderExt-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FileProviderExt-Bridging-Header.h"; sourceTree = ""; }; 5352B36B29DC44B50011CE03 /* FileProviderExtension+Thumbnailing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileProviderExtension+Thumbnailing.swift"; sourceTree = ""; }; - 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Progress+Extensions.swift"; sourceTree = ""; }; 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+Extensions.swift"; sourceTree = ""; }; 53651E452BBC0D9500ECAC29 /* ShareeSuggestionsDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareeSuggestionsDataSource.swift; sourceTree = ""; }; 536EFBF6295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderSocketLineProcessor.swift; sourceTree = ""; }; @@ -272,8 +268,6 @@ isa = PBXGroup; children = ( 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */, - 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */, - 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */, ); path = Extensions; sourceTree = ""; @@ -675,12 +669,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5352E85B29B7BFE6002CE85C /* Progress+Extensions.swift in Sources */, 53D666612B70C9A70042C03D /* FileProviderConfig.swift in Sources */, 53ED473029C9CE0B00795DB1 /* FileProviderExtension+ClientInterface.swift in Sources */, 538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */, 536EFBF7295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift in Sources */, - 5318AD9929BF58D000CBB71C /* NKError+Extensions.swift in Sources */, 537630972B860D920026BFAB /* FPUIExtensionService.swift in Sources */, 535AE30E29C0A2CC0042A9BA /* Logger+Extensions.swift in Sources */, 537630952B860D560026BFAB /* FPUIExtensionServiceSource.swift in Sources */,