mirror of https://github.com/nextcloud/desktop
Remove unused components in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
c082c446c1
commit
9e7ce1640d
|
@ -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")
|
||||
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2023 by Claudio Cambra <claudio.cambra@nextcloud.com>
|
||||
*
|
||||
* 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)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2023 by Claudio Cambra <claudio.cambra@nextcloud.com>
|
||||
*
|
||||
* 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
|
||||
}
|
||||
}
|
|
@ -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 = "<group>"; };
|
||||
5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NKError+Extensions.swift"; sourceTree = "<group>"; };
|
||||
5350E4E72B0C514400F276CB /* ClientCommunicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClientCommunicationProtocol.h; sourceTree = "<group>"; };
|
||||
5350E4E82B0C534A00F276CB /* ClientCommunicationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientCommunicationService.swift; sourceTree = "<group>"; };
|
||||
5350E4EA2B0C9CE100F276CB /* FileProviderExt-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FileProviderExt-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
5352B36B29DC44B50011CE03 /* FileProviderExtension+Thumbnailing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileProviderExtension+Thumbnailing.swift"; sourceTree = "<group>"; };
|
||||
5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Progress+Extensions.swift"; sourceTree = "<group>"; };
|
||||
535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+Extensions.swift"; sourceTree = "<group>"; };
|
||||
53651E452BBC0D9500ECAC29 /* ShareeSuggestionsDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareeSuggestionsDataSource.swift; sourceTree = "<group>"; };
|
||||
536EFBF6295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderSocketLineProcessor.swift; sourceTree = "<group>"; };
|
||||
|
@ -272,8 +268,6 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */,
|
||||
5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */,
|
||||
5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
|
@ -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 */,
|
||||
|
|
Loading…
Reference in New Issue