Просмотр исходного кода

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 лет назад
Родитель
Сommit
7d416b1257

+ 1 - 3
Widget/Dashboard/DashboardData.swift

@@ -157,7 +157,6 @@ func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize:
                         var iconFileName: String?
 
                         if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
-                            var size = CGFloat(NCGlobal.shared.sizeIcon)
                             if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
 
                                 let path = (urlComponents.path as NSString)
@@ -168,13 +167,12 @@ func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize:
                                     iconFileName = item
                                 } else if pathComponents[1] == "avatar" {
                                     iconFileName = pathComponents[2]
-                                    size = CGFloat(NCGlobal.shared.avatarSize)
                                 } else {
                                     iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
                                 }
                             }
                             let semaphore = DispatchSemaphore(value: 0)
-                            NCUtility.shared.getImageUserData(url: url, fileName: iconFileName, size: size) { image in
+                            NCUtility.shared.getWidgetImageUserData(url: url, fileName: iconFileName) { image in
                                 if let image = image {
                                     icon = image
                                 }

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -277,7 +277,7 @@ class NCService: NSObject {
                 NCManageDatabase.shared.addDashboardWidget(account: account, dashboardWidgets: dashboardWidgets)
                 for widget in dashboardWidgets {
                     if let url = URL(string: widget.iconUrl), let fileName = widget.iconClass {
-                        NCUtility.shared.getImageUserData(url: url, fileName: fileName, size: CGFloat(NCGlobal.shared.sizeIcon))
+                        NCUtility.shared.getWidgetImageUserData(url: url, fileName: fileName)
                     }
                 }
             }

+ 2 - 2
iOSClient/Utility/NCUtility.swift

@@ -995,9 +995,9 @@ class NCUtility: NSObject {
         return imagePreview
     }
     
-    func getImageUserData(url: URL, fileName: String?, size: CGFloat, completition: @escaping (_ image: UIImage?) -> () = { _ in }) {
+    func getWidgetImageUserData(url: URL, fileName: String?, completition: @escaping (_ image: UIImage?) -> () = { _ in }) {
 
-        let size = CGSize(width: size, height: size)
+        let size = CGSize(width: 256, height: 256)
         let options = NKRequestOptions(queue: NKCommon.shared.backgroundQueue)
 
         if let fileName = fileName {