marinofaggiana 4 سال پیش
والد
کامیت
095e87f2ba
5فایلهای تغییر یافته به همراه30 افزوده شده و 52 حذف شده
  1. 0 1
      iOSClient/AppDelegate.h
  2. 9 7
      iOSClient/AppDelegate.m
  3. 12 3
      iOSClient/Database/NCManageDatabase.swift
  4. 9 36
      iOSClient/Main/CCMain.m
  5. 0 5
      iOSClient/Networking/NCService.swift

+ 0 - 1
iOSClient/AppDelegate.h

@@ -131,7 +131,6 @@
 
 // Setting Account
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activeUserID:(NSString *)activeUserID activePassword:(NSString *)activePassword;
-- (void)settingWebDavRoot:(NSString *)webdavRoot;
 - (void)deleteAccount:(NSString *)account wipe:(BOOL)wipe;
 
 // Quick Actions - ShotcutItem

+ 9 - 7
iOSClient/AppDelegate.m

@@ -443,13 +443,15 @@
     [[NCCommunicationCommon sharedInstance] setupWithUser:activeUser userId:activeUserID password:activePassword url:activeUrl userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups nextcloudVersion:capabilities.versionMajor delegate:[NCNetworking sharedInstance]];
     
     OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
-    [communication setupNextcloudVersion:[[NCManageDatabase sharedInstance] getCapabilitiesServerVersionMajorWithAccount:activeAccount]];
-}
-
-- (void)settingWebDavRoot:(NSString *)webdavRoot
-{
-    if (webdavRoot != nil) {
-        [[NCCommunicationCommon sharedInstance] setupWithWebDavRoot:webdavRoot];
+    
+    NSInteger serverVersionMajor = [[NCManageDatabase sharedInstance] getCapabilitiesServerVersionMajorWithAccount:activeAccount];
+    if (serverVersionMajor > 0) {
+        [communication setupNextcloudVersion: serverVersionMajor];
+    }
+   
+    NSString *webDavRoot = [[NCManageDatabase sharedInstance] getCapabilitiesWebDavRootWithAccount:activeAccount];
+    if (webDavRoot != nil) {
+        [[NCCommunicationCommon sharedInstance] setupWithWebDavRoot:webDavRoot];
     }
 }
 

+ 12 - 3
iOSClient/Database/NCManageDatabase.swift

@@ -905,8 +905,11 @@ class NCManageDatabase: NSObject {
         guard let result = realm.objects(tableCapabilities.self).filter("account == %@", account).first else {
             return 0
         }
+        guard let jsondata = result.jsondata else {
+            return 0
+        }
         
-        let json = JSON(result.jsondata! as Data)
+        let json = JSON(jsondata)
         let data = json["ocs"]["data"]
 
         if let versionMajor = data["version"]["major"].int {
@@ -924,8 +927,11 @@ class NCManageDatabase: NSObject {
         guard let result = realm.objects(tableCapabilities.self).filter("account == %@", account).first else {
             return nil
         }
+        guard let jsondata = result.jsondata else {
+            return nil
+        }
         
-        let json = JSON(result.jsondata! as Data)
+        let json = JSON(jsondata)
         let dataCapabilities = json["ocs"]["data"]["capabilities"]
 
         if let webDavRoot = dataCapabilities["core"]["webdav-root"].string {
@@ -943,8 +949,11 @@ class NCManageDatabase: NSObject {
         guard let result = realm.objects(tableCapabilities.self).filter("account == %@", account).first else {
             return 0
         }
+        guard let jsondata = result.jsondata else {
+            return 0
+        }
         
-        let json = JSON(result.jsondata! as Data)
+        let json = JSON(jsondata)
         let dataCapabilities = json["ocs"]["data"]["capabilities"]
 
         if let version = dataCapabilities["end-to-end-encryption"]["api-version"].string {

+ 9 - 36
iOSClient/Main/CCMain.m

@@ -725,49 +725,22 @@
         self.navigationItem.title = [NSString stringWithFormat:@"%@ : %lu / %lu", NSLocalizedString(@"_selected_", nil), (unsigned long)selezionati, (unsigned long)totali];
 
     } else {
-        if (@available(iOS 11.0, *)) {
-            if (_isRoot) {
-                    self.navigationController.navigationBar.prefersLargeTitles = true;
-                    self.navigationItem.title = NCBrandOptions.sharedInstance.brand;
-                
-                    self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
+       
+        if (_isRoot) {
+            
+            self.navigationItem.title = NCBrandOptions.sharedInstance.brand;
+            self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
                 
-            } else {
-                self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
-            }
+        } else {
+            
+            self.navigationItem.title = _titleMain;
+            self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
         }
     }
     
     [self SetSortButtonText];
 }
 
-/*
-- (UIImage *)getImageLogoHome
-{
-    UIImage *image = [UIImage imageNamed:@"themingLogo"];
-    
-    tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:appDelegate.activeAccount];
-    if ([NCBrandOptions sharedInstance].use_themingColor && [capabilities.themingColorText isEqualToString:@"#000000"] && [UIImage imageNamed:@"themingLogoBlack"]) {
-        image = [UIImage imageNamed:@"themingLogoBlack"];
-    }
-   
-    if ([NCBrandOptions sharedInstance].use_themingLogo) {
-        
-        image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@-themingLogo.png", [CCUtility getDirectoryUserData], [CCUtility getStringUser:appDelegate.activeUser activeUrl:appDelegate.activeUrl]]];
-        if (image == nil) image = [UIImage imageNamed:@"themingLogo"];
-    }
-        
-    if ([appDelegate.reachability isReachable] == NO) {
-            
-        return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"nonetwork"] width:50 height:50 color:NCBrandColor.sharedInstance.icon];
-            
-    } else {
-        
-        return image;
-    }
-}
-*/
-
 - (void)setUINavigationBarDefault
 {
     UIBarButtonItem *buttonSelect = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_select_", @"") style:UIBarButtonItemStylePlain target:self action:@selector(tableViewToggle)];

+ 0 - 5
iOSClient/Networking/NCService.swift

@@ -147,11 +147,6 @@ class NCService: NSObject {
             
             if errorCode == 0 && data != nil {
                 NCManageDatabase.sharedInstance.addCapabilitiesJSon(data!, account: account)
-                
-                // Update webDavRoot
-                if let webDavRoot = NCManageDatabase.sharedInstance.getCapabilitiesWebDavRoot(account: account) {
-                     self.appDelegate.settingWebDavRoot(webDavRoot)
-                }
             }
         }