Эх сурвалжийг харах

Merge pull request #2127 from nextcloud/develop

4.4.2
Marino Faggiana 2 жил өмнө
parent
commit
632c6214a5

+ 13 - 18
Nextcloud.xcodeproj/project.pbxproj

@@ -809,6 +809,8 @@
 		F78F74352163781100C2ADAD /* NCTrash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrash.swift; sourceTree = "<group>"; };
 		F790110D21415BF600D7B136 /* NCViewerRichdocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerRichdocument.swift; sourceTree = "<group>"; };
 		F79018A424092EF4007C9B6D /* ATGMediaBrowser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ATGMediaBrowser.framework; path = Carthage/Build/iOS/ATGMediaBrowser.framework; sourceTree = "<group>"; };
+		F79131C628AFB86E00577277 /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/Localizable.strings; sourceTree = "<group>"; };
+		F79131C728AFB86E00577277 /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		F79918A021997F9000C2E308 /* UICKeyChainStore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UICKeyChainStore.framework; path = Carthage/Build/iOS/UICKeyChainStore.framework; sourceTree = "<group>"; };
 		F79918A72199840500C2E308 /* Sheeeeeeeeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sheeeeeeeeet.framework; path = Carthage/Build/iOS/Sheeeeeeeeet.framework; sourceTree = "<group>"; };
 		F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCSelect.storyboard; sourceTree = "<group>"; };
@@ -2183,6 +2185,7 @@
 				gl,
 				ca,
 				da,
+				eu,
 			);
 			mainGroup = F7F67B9F1A24D27800EE80DA;
 			packageReferences = (
@@ -2765,6 +2768,7 @@
 				F7AA41DF27C7CF7E00494705 /* es-PY */,
 				F7AA41E027C7CF8000494705 /* es-NI */,
 				F7AA41E127C7CF8100494705 /* es-MX */,
+				F79131C728AFB86E00577277 /* eu */,
 			);
 			name = InfoPlist.strings;
 			path = "Supporting Files";
@@ -2816,6 +2820,7 @@
 				F753701822723D620041C76C /* gl */,
 				F753701922723E0D0041C76C /* ca */,
 				F753701A22723EC80041C76C /* da */,
+				F79131C628AFB86E00577277 /* eu */,
 			);
 			name = Localizable.strings;
 			path = "Supporting Files";
@@ -2828,7 +2833,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.entitlements";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2846,7 +2850,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.entitlements";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2865,7 +2868,6 @@
 			buildSettings = {
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_HARDENED_RUNTIME = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.NextcloudTests;
@@ -2879,7 +2881,6 @@
 			buildSettings = {
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_HARDENED_RUNTIME = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.NextcloudTests;
@@ -2892,7 +2893,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2910,7 +2910,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2928,7 +2927,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/File_Provider_Extension.entitlements";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2946,7 +2944,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/File_Provider_Extension.entitlements";
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
 					EXTENSION,
@@ -2965,7 +2962,6 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2977,7 +2973,6 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
-				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3011,8 +3006,8 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 19;
-				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				CURRENT_PROJECT_VERSION = 0;
+				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3035,11 +3030,11 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 4.4.1;
+				MARKETING_VERSION = 4.4.2;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) NC";
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) NC DEBUG";
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/iOSClient/Brand/Nextcloud-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
@@ -3074,8 +3069,8 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 19;
-				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				CURRENT_PROJECT_VERSION = 0;
+				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3096,11 +3091,11 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 4.4.1;
+				MARKETING_VERSION = 4.4.2;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG NC";
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) NC";
 				SWIFT_COMPILATION_MODE = wholemodule;
 				SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/iOSClient/Brand/Nextcloud-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-O";

+ 14 - 7
iOSClient/Data/NCDataSource.swift

@@ -117,7 +117,7 @@ class NCDataSource: NSObject {
             if filterLivePhoto && metadata.livePhoto && metadata.ext == "mov" {
                 continue
             }
-            let section = NSLocalizedString(self.getSectionValue(metadata: metadata), comment: "").lowercased().firstUppercased
+            let section = NSLocalizedString(self.getSectionValue(metadata: metadata), comment: "")
             if !self.sectionsValue.contains(section) {
                 self.sectionsValue.append(section)
             }
@@ -127,15 +127,14 @@ class NCDataSource: NSObject {
         if let providers = self.providers, !providers.isEmpty {
             let sectionsDictionary = ThreadSafeDictionary<String,Int>()
             for section in self.sectionsValue {
-                if let provider = providers.filter({ $0.name.lowercased() == section.lowercased()}).first {
+                if let provider = providers.filter({ $0.id == section}).first {
                     sectionsDictionary[section] = provider.order
                 }
             }
             self.sectionsValue.removeAll()
             let sectionsDictionarySorted = sectionsDictionary.sorted(by: { $0.value < $1.value } )
-            let appName = NSLocalizedString(NCGlobal.shared.appName, comment: "").lowercased().firstUppercased
             for section in sectionsDictionarySorted {
-                if section.key == appName {
+                if section.key == NCGlobal.shared.appName {
                     self.sectionsValue.insert(section.key, at: 0)
                 } else {
                     self.sectionsValue.append(section.key)
@@ -172,7 +171,7 @@ class NCDataSource: NSObject {
 
         var searchResult: NCCSearchResult?
         if let providers = self.providers, !providers.isEmpty, let searchResults = self.searchResults {
-            searchResult = searchResults.filter({ $0.name == sectionValue}).first
+            searchResult = searchResults.filter({ $0.id == sectionValue}).first
         }
         let metadatas = self.metadatas.filter({ getSectionValue(metadata: $0) == sectionValue})
         let metadataForSection = NCMetadataForSection.init(sectionValue: sectionValue,
@@ -356,6 +355,14 @@ class NCDataSource: NSObject {
         return metadataForSection.sectionValue
     }
 
+    func getSectionValueLocalization(indexPath: IndexPath) -> String {
+        guard metadatasForSection.count > 0 , let metadataForSection = self.getMetadataForSection(indexPath.section) else { return ""}
+        if let searchResults = self.searchResults, let searchResult = searchResults.filter({ $0.id == metadataForSection.sectionValue}).first {
+            return searchResult.name
+        }
+        return metadataForSection.sectionValue
+    }
+
     func getFooterInformationAllMetadatas() -> (directories: Int, files: Int, size: Int64) {
 
         var directories: Int = 0
@@ -377,11 +384,11 @@ class NCDataSource: NSObject {
 
         switch self.groupByField {
         case "name":
-            return NSLocalizedString(metadata.name, comment: "").lowercased().firstUppercased
+            return NSLocalizedString(metadata.name, comment: "")
         case "classFile":
             return NSLocalizedString(metadata.classFile, comment: "").lowercased().firstUppercased
         default:
-            return NSLocalizedString(metadata.name, comment: "").lowercased().firstUppercased
+            return NSLocalizedString(metadata.classFile, comment: "")
         }
     }
 

+ 1 - 1
iOSClient/Data/NCDatabase.swift

@@ -386,7 +386,7 @@ class tableMetadata: Object, NCUserBaseUrl {
     @objc dynamic var isExtractFile: Bool = false
     @objc dynamic var livePhoto: Bool = false
     @objc dynamic var mountType = ""
-    @objc dynamic var name = ""
+    @objc dynamic var name = ""                                             // for unifiedSearch is the provider.id
     @objc dynamic var note = ""
     @objc dynamic var ocId = ""
     @objc dynamic var ownerId = ""

+ 2 - 3
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1707,9 +1707,8 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 header.setSectionHeight(heightHeaderSection)
                 if heightHeaderSection == 0 {
                     header.labelSection.text = ""
-
                 } else {
-                    header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath)
+                    header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
                 }
                 header.labelSection.textColor = NCBrandColor.shared.label
 
@@ -1719,7 +1718,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
 
                 let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeader", for: indexPath) as! NCSectionHeader
 
-                header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath)
+                header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
                 header.labelSection.textColor = NCBrandColor.shared.label
 
                 return header

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -864,7 +864,7 @@ import Photos
                 })
             default:
                 partialResult.entries.forEach({ entry in
-                    let metadata = NCManageDatabase.shared.createMetadata(account: urlBase.account, user: urlBase.user, userId: urlBase.userId, fileName: entry.title, fileNameView: entry.title, ocId: NSUUID().uuidString, serverUrl: urlBase.urlBase, urlBase: urlBase.urlBase, url: entry.resourceURL, contentType: "", isUrl: true, name: partialResult.name.lowercased(), subline: entry.subline, iconName: entry.icon, iconUrl: entry.thumbnailURL)
+                    let metadata = NCManageDatabase.shared.createMetadata(account: urlBase.account, user: urlBase.user, userId: urlBase.userId, fileName: entry.title, fileNameView: entry.title, ocId: NSUUID().uuidString, serverUrl: urlBase.urlBase, urlBase: urlBase.urlBase, url: entry.resourceURL, contentType: "", isUrl: true, name: partialResult.id, subline: entry.subline, iconName: entry.icon, iconUrl: entry.thumbnailURL)
                     metadatas.append(metadata)
                 })
             }

+ 2 - 2
iOSClient/Select/NCSelect.swift

@@ -611,7 +611,7 @@ extension NCSelect: UICollectionViewDataSource {
                 if heightHeaderSection == 0 {
                     header.labelSection.text = ""
                 } else {
-                    header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath)
+                    header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
                 }
                 header.labelSection.textColor = NCBrandColor.shared.label
 
@@ -621,7 +621,7 @@ extension NCSelect: UICollectionViewDataSource {
 
                 let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeader", for: indexPath) as! NCSectionHeader
 
-                header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath)
+                header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
                 header.labelSection.textColor = NCBrandColor.shared.brandElement
 
                 return header

BIN
iOSClient/Supporting Files/eu.lproj/Localizable.strings