Browse Source

clear code

marinofaggiana 4 years ago
parent
commit
f65702ab3f

+ 5 - 1
iOSClient/Brand/NCBrand.swift

@@ -217,8 +217,12 @@ class NCBrandColor: NSObject {
     }()
 
     // Directory on Group
-    @objc let appDatabaseNextcloud                   = "Library/Application Support/Nextcloud"
+    @objc let appDatabaseNextcloud                  = "Library/Application Support/Nextcloud"
 
+    // Nextcloud version
+    let nextcloudVersion17: Int                     =  17
+    let nextcloudVersion18: Int                     =  18
+    
     // Database Realm
     let databaseDefault                             = "nextcloud.realm"
     let databaseSchemaVersion: UInt64               = 160

+ 0 - 4
iOSClient/CCGlobal.h

@@ -217,10 +217,6 @@
 #define k_template_spreadsheet                          @"spreadsheet"
 #define k_template_presentation                         @"presentation"
 
-// Nextcloud version
-#define k_nextcloud_version_17_0                        17
-#define k_nextcloud_version_18_0                        18
-
 // Notification Center
 
 #define k_notificationCenter_applicationDidEnterBackground  @"applicationDidEnterBackground"

+ 1 - 1
iOSClient/Diagnostics/NCCapabilitiesViewController.swift

@@ -181,7 +181,7 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
                 
                 // EDITORS
                 let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-                if serverVersionMajor >= k_nextcloud_version_18_0 {
+                if serverVersionMajor >= NCBrandGlobal.shared.nextcloudVersion18 {
                     NCCommunication.shared.NCTextObtainEditorDetails() { (account, editors, creators, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.account {
                             NCManageDatabase.shared.addDirectEditing(account: account, editors: editors, creators: creators)

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

@@ -169,7 +169,7 @@ extension AppDelegate: NCAudioRecorderViewControllerDelegate {
             )
         )
 
-        if serverVersionMajor >= k_nextcloud_version_18_0 && directory?.richWorkspace == nil && !isEncrypted && NCCommunication.shared.isNetworkReachable() {
+        if serverVersionMajor >= NCBrandGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isEncrypted && NCCommunication.shared.isNetworkReachable() {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_add_folder_info_", comment: ""),

+ 1 - 1
iOSClient/Networking/NCNetworkingCheckRemoteUser.swift

@@ -43,7 +43,7 @@ import NCCommunication
         let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
         guard let tableAccount = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) else { return }
         
-        if serverVersionMajor >= k_nextcloud_version_17_0 {
+        if serverVersionMajor >= NCBrandGlobal.shared.nextcloudVersion17 {
             
             guard let token = CCUtility.getPassword(account) else { return }
             

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -196,7 +196,7 @@ class NCService: NSObject {
                 
                     // Text direct editor detail
                     let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
-                    if serverVersionMajor >= k_nextcloud_version_18_0 {
+                    if serverVersionMajor >= NCBrandGlobal.shared.nextcloudVersion18 {
                         NCCommunication.shared.NCTextObtainEditorDetails() { (account, editors, creators, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.account {