From 9d8b6a4c948207850348cba3c107cda2a44067aa Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Thu, 6 Jun 2024 12:25:53 +0200 Subject: [PATCH] cleaning code Signed-off-by: Marino Faggiana --- Nextcloud.xcodeproj/project.pbxproj | 4 ---- .../WidgetDashboardIntentHandler-Brinding-header.h | 4 ---- iOSClient/Networking/NCAutoUpload.swift | 2 +- iOSClient/Utility/NCUtilityFileSystem.swift | 4 ++-- iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift | 3 +-- 5 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 4521fa904a..372c1b2bd2 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -1491,7 +1491,6 @@ F7A60F84292D215000FCE1F2 /* NCShareAccounts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCShareAccounts.swift; sourceTree = ""; }; F7A60F85292D215000FCE1F2 /* NCShareAccounts.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCShareAccounts.storyboard; sourceTree = ""; }; F7A846DD2BB01ACB0024816F /* NCTrashCellProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashCellProtocol.swift; sourceTree = ""; }; - F7A8D72228F176B6008BBE1C /* WidgetDashboardIntentHandler-Brinding-header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WidgetDashboardIntentHandler-Brinding-header.h"; sourceTree = ""; }; F7AA41B827C7CF4600494705 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/InfoPlist.strings; sourceTree = ""; }; F7AA41B927C7CF4B00494705 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = ""; }; F7AA41BA27C7CF5000494705 /* zh-Hant-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant-TW"; path = "zh-Hant-TW.lproj/InfoPlist.strings"; sourceTree = ""; }; @@ -2754,7 +2753,6 @@ F7C9739328F17131002C43E2 /* WidgetDashboardIntentHandler */ = { isa = PBXGroup; children = ( - F7A8D72228F176B6008BBE1C /* WidgetDashboardIntentHandler-Brinding-header.h */, F7C9739428F17131002C43E2 /* IntentHandler.swift */, ); path = WidgetDashboardIntentHandler; @@ -5272,7 +5270,6 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_WIDGETDASHBOARDINTENTHANDLER"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -5313,7 +5310,6 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_WIDGETDASHBOARDINTENTHANDLER"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; diff --git a/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h b/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h deleted file mode 100644 index 1b2cb5d6d0..0000000000 --- a/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h +++ /dev/null @@ -1,4 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - diff --git a/iOSClient/Networking/NCAutoUpload.swift b/iOSClient/Networking/NCAutoUpload.swift index 404827529b..ce928aa1b2 100644 --- a/iOSClient/Networking/NCAutoUpload.swift +++ b/iOSClient/Networking/NCAutoUpload.swift @@ -115,7 +115,7 @@ class NCAutoUpload: NSObject { let assetDate = asset.creationDate ?? Date() let assetMediaType = asset.mediaType var serverUrl: String = "" - let fileName = NCUtilityFileSystem().createFileName(asset.originalFilename as String, + let fileName = NCUtilityFileSystem().createFileName(asset.originalFilename as String, fileDate: assetDate, fileType: assetMediaType, keyFileName: NCGlobal.shared.keyFileNameAutoUploadMask, diff --git a/iOSClient/Utility/NCUtilityFileSystem.swift b/iOSClient/Utility/NCUtilityFileSystem.swift index d2cdb0bfa0..580601e50e 100644 --- a/iOSClient/Utility/NCUtilityFileSystem.swift +++ b/iOSClient/Utility/NCUtilityFileSystem.swift @@ -430,8 +430,8 @@ class NCUtilityFileSystem: NSObject { func createFileName(_ fileName: String, fileDate: Date, fileType: PHAssetMediaType, keyFileName: String?, keyFileNameType: String, keyFileNameOriginal: String, forcedNewFileName: Bool) -> String { var fileName = fileName let keychain = NCKeychain() - var addFileNameType: Bool = keychain.getFileNameType(key: keyFileNameType) - var useFileNameOriginal: Bool = keychain.getOriginalFileName(key: keyFileNameOriginal) + let addFileNameType: Bool = keychain.getFileNameType(key: keyFileNameType) + let useFileNameOriginal: Bool = keychain.getOriginalFileName(key: keyFileNameOriginal) var numberFileName: String = "" var fileNameType = "" let fileNameExt = (fileName as NSString).pathExtension.lowercased() diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift index c149c6c8ba..3fc386c197 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift @@ -399,8 +399,7 @@ class NCViewerMediaPage: UIViewController { @objc func deleteFile(_ notification: NSNotification) { guard let userInfo = notification.userInfo as NSDictionary? else { return } - if let ocIds = userInfo["ocId"] as? [String], - let ocId = ocIds.first { + if let ocIds = userInfo["ocId"] as? [String] { // Stop media if let ncplayer = currentViewController.ncplayer, ncplayer.isPlay() { ncplayer.playerPause()