瀏覽代碼

Add capabilities : background-default , background-plain

Marino Faggiana 7 年之前
父節點
當前提交
01815527a2

+ 2 - 0
iOSClient/Database/NCDatabase.swift

@@ -76,6 +76,8 @@ class tableCapabilities: Object {
     
     @objc dynamic var account = ""
     @objc dynamic var themingBackground = ""
+    @objc dynamic var themingBackgroundDefault: Bool = false
+    @objc dynamic var themingBackgroundPlain: Bool = false
     @objc dynamic var themingColor = ""
     @objc dynamic var themingColorElement = ""
     @objc dynamic var themingColorText = ""

+ 4 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -57,7 +57,7 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 15,
+            schemaVersion: 16,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
@@ -65,6 +65,7 @@ class NCManageDatabase: NSObject {
             // 13 : Version 2.19.0.14
             // 14 : Version 2.19.0.xx
             // 15 : Version 2.19.2
+            // 16 : Version 2.20.2
             
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0
@@ -583,6 +584,8 @@ class NCManageDatabase: NSObject {
                 
                 resultCapabilities.account = tableAccount.account
                 resultCapabilities.themingBackground = capabilities.themingBackground
+                resultCapabilities.themingBackgroundDefault = capabilities.themingBackgroundDefault
+                resultCapabilities.themingBackgroundPlain = capabilities.themingBackgroundPlain
                 resultCapabilities.themingColor = capabilities.themingColor
                 resultCapabilities.themingColorElement = capabilities.themingColorElement
                 resultCapabilities.themingColorText = capabilities.themingColorText

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCCapabilities.h

@@ -59,6 +59,8 @@
 
 // Theming
 @property (nonatomic, strong) NSString *themingBackground;
+@property (nonatomic) BOOL themingBackgroundDefault;
+@property (nonatomic) BOOL themingBackgroundPlain;
 @property (nonatomic, strong) NSString *themingColor;
 @property (nonatomic, strong) NSString *themingColorElement;
 @property (nonatomic, strong) NSString *themingColorText;

+ 10 - 0
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -1413,6 +1413,16 @@
                     if ([theming valueForKey:@"background"] && ![[theming valueForKey:@"background"] isEqual:[NSNull null]])
                         capabilities.themingBackground = [theming valueForKey:@"background"];
                 
+                    if ([theming valueForKey:@"background-default"] && ![[theming valueForKey:@"background-default"] isEqual:[NSNull null]]) {
+                        NSNumber *result = (NSNumber*)[theming valueForKey:@"background-default"];
+                        capabilities.themingBackgroundDefault = result.boolValue;
+                    }
+                    
+                    if ([theming valueForKey:@"background-plain"] && ![[theming valueForKey:@"background-plain"] isEqual:[NSNull null]]) {
+                        NSNumber *result = (NSNumber*)[theming valueForKey:@"background-plain"];
+                        capabilities.themingBackgroundPlain = result.boolValue;
+                    }
+                    
                     if ([theming valueForKey:@"color"] && ![[theming valueForKey:@"color"] isEqual:[NSNull null]])
                         capabilities.themingColor = [theming valueForKey:@"color"];