marinofaggiana 4 years ago
parent
commit
44b8d8743c

+ 1 - 1
Cartfile

@@ -4,7 +4,7 @@ github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "jdg/MBProgressHUD" "1.1.0"
-github "realm/realm-cocoa" "v5.3.6"
+github "realm/realm-cocoa" "v5.4.0"
 github "SVGKit/SVGKit" "3.x"
 github "WeTransfer/WeScan" "1.2.0"
 github "malcommac/SwiftRichString"

+ 1 - 1
Cartfile.resolved

@@ -19,7 +19,7 @@ github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
 github "nextcloud/ios-communication-library" "856c5e5375b13c70e8cac87f4e8cc5d14045efcd"
-github "realm/realm-cocoa" "v5.3.6"
+github "realm/realm-cocoa" "v5.4.0"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.5"
 github "tilltue/TLPhotoPicker" "2.0.12"

+ 33 - 0
Carthage/Checkouts/realm-cocoa/CHANGELOG.md

@@ -1,3 +1,36 @@
+5.4.0 Release notes (2020-09-09)
+=============================================================
+
+This version bumps the Realm file format version. This means that older
+versions of Realm will be unable to open Realm files written by this version,
+and a new version of Realm Studio will be required. There are no actual format
+changes and the version bump is just to force a re-migration of incorrectly
+upgraded Realms.
+
+### Fixed
+
+* Upgrading pre-5.x files with string primary keys would result in a file where
+  `realm.object(ofType:forPrimaryKey:)` would fail to find the object.
+  ([#6716](https://github.com/realm/realm-cocoa/issues/6716), since 5.2.0)
+* A write transaction which modifies an object with more than 16 managed
+  properties and causes the Realm file to grow larger than 2 GB could cause an
+  assertion failure mentioning "m_has_refs". ([JS #3194](https://github.com/realm/realm-js/issues/3194), since 5.0.0).
+* Objects with more than 32 properties could corrupt the Realm file and result
+  in a variety of crashes. ([Java #7057](https://github.com/realm/realm-java/issues/7057), since 5.0.0).
+
+### Compatibility
+
+* File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Realm Studio: 3.12 or later.
+* APIs are backwards compatible with all previous releases in the 5.x.y series.
+* Carthage release for Swift is built with Xcode 11.6.
+
+### Internal
+
+* Upgraded realm-core from v6.0.23 to v6.0.25
+* Upgraded realm-sync from v5.0.20 to v5.0.22
+
 5.3.6 Release notes (2020-09-02)
 =============================================================
 

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>5.3.6</string>
+	<string>5.4.0</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>5.3.6</string>
+	<string>5.4.0</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2014 Realm. All rights reserved.</string>
 	<key>NSPrincipalClass</key>

+ 2 - 2
Carthage/Checkouts/realm-cocoa/build.sh

@@ -1534,9 +1534,9 @@ x.y.z Release notes (yyyy-MM-dd)
 <!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->
 
 ### Compatibility
-* File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
+* File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
 * Realm Object Server: 3.21.0 or later.
-* Realm Studio: 3.11 or later.
+* Realm Studio: 3.12 or later.
 * APIs are backwards compatible with all previous releases in the 5.x.y series.
 * Carthage release for Swift is built with Xcode 11.6.
 

+ 3 - 3
Carthage/Checkouts/realm-cocoa/dependencies.list

@@ -1,4 +1,4 @@
-VERSION=5.3.6
-REALM_CORE_VERSION=6.0.23
-REALM_SYNC_VERSION=5.0.20
+VERSION=5.4.0
+REALM_CORE_VERSION=6.0.25
+REALM_SYNC_VERSION=5.0.22
 REALM_OBJECT_SERVER_VERSION=3.28.5

+ 0 - 1
iOSClient/Main/CCMain.h

@@ -88,7 +88,6 @@
 
 - (void)minCharTextFieldDidChange:(UITextField *)sender;
 - (void)actionDelete:(NSIndexPath *)indexPath;
-- (void)createRichWorkspace;
 
 @end
 

+ 0 - 12
iOSClient/Main/CCMain.m

@@ -1450,18 +1450,6 @@
     [self presentViewController:navigationController animated:NO completion:NULL];
 }
 
-- (void)createRichWorkspace
-{
-    NCRichWorkspaceCommon *richWorkspaceCommon = [NCRichWorkspaceCommon new];
-    tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", appDelegate.account, self.serverUrl, k_fileNameRichWorkspace.lowercaseString]];
-    
-    if (metadata) {
-        [richWorkspaceCommon openViewerNextcloudTextWithServerUrl:self.serverUrl viewController:self];
-    } else {
-        [richWorkspaceCommon createViewerNextcloudTextWithServerUrl:self.serverUrl viewController:self];
-    }
-}
-
 - (void)toggleSortMenu
 {
     NCSortMenu *sortMenu = [NCSortMenu new];

+ 4 - 0
iOSClient/Main/Collection/NCCollectionViewCommon.swift

@@ -761,6 +761,10 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             return collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
         }
         
+        if metadata.fileNameView.uppercased() == k_fileNameRichWorkspace.uppercased() && richWorkspaceText?.count == 0 {
+            
+        }
+        
         if layout == k_layout_grid {
             
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell

+ 8 - 1
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -161,7 +161,14 @@ extension AppDelegate {
                     title: NSLocalizedString("_add_folder_info_", comment: ""),
                     icon: CCGraphics.changeThemingColorImage(UIImage(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                     action: { menuAction in
-                        self.activeMain.createRichWorkspace()
+                        let richWorkspaceCommon = NCRichWorkspaceCommon()
+                        if let viewController = appDelegate.window.rootViewController {
+                            if NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", appDelegate.account, appDelegate.activeServerUrl, k_fileNameRichWorkspace.lowercased())) == nil {
+                                richWorkspaceCommon.createViewerNextcloudText(serverUrl: appDelegate.activeServerUrl, viewController: viewController)
+                            } else {
+                                richWorkspaceCommon.openViewerNextcloudText(serverUrl: appDelegate.activeServerUrl, viewController: viewController)
+                            }
+                        }
                     }
                 )
             )