marinofaggiana 4 жил өмнө
parent
commit
68d2bcc06c

+ 1 - 7
iOSClient/AppDelegate.swift

@@ -57,16 +57,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     var activeViewController: UIViewController?
     var activeViewerVideo: NCViewerVideo?
     
-    struct progressType {
-        var progress: Float
-        var totalBytes: Int64
-        var totalBytesExpected: Int64
-    }
-    
     var listFilesVC: [String:NCFiles] = [:]
     var listFavoriteVC: [String:NCFavorite] = [:]
     var listOfflineVC: [String:NCOffline] = [:]
-    var listProgress: [String:progressType] = [:]
+    var listProgress: [String:NCGlobal.progressType] = [:]
     
     var disableSharesView: Bool = false
     var documentPickerViewController: NCDocumentPickerViewController?

+ 2 - 4
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -507,11 +507,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 let totalBytes = userInfo["totalBytes"] as? Int64 ?? 0
                 let totalBytesExpected = userInfo["totalBytesExpected"] as? Int64 ?? 0
                         
-                let progressType = AppDelegate.progressType(progress: progress, totalBytes: totalBytes, totalBytesExpected: totalBytesExpected)
+                let progressType = NCGlobal.progressType(progress: progress, totalBytes: totalBytes, totalBytesExpected: totalBytesExpected)
                 appDelegate.listProgress[ocId] = progressType
-                
-                //appDelegate.listProgressMetadata.setObject([progress as NSNumber, totalBytes as NSNumber, totalBytesExpected as NSNumber], forKey: userInfo["ocId"] as? NSString ?? "")
-                
+                                
                 if let index = dataSource.getIndexMetadata(ocId: ocId) {
                     if let cell = collectionView?.cellForItem(at: IndexPath(row: index, section: 0)) {
                         if cell is NCListCell {

+ 7 - 0
iOSClient/NCGlobal.swift

@@ -29,6 +29,13 @@ import Foundation
         return instance
     }()
 
+    // Struct for Progress
+    struct progressType {
+        var progress: Float
+        var totalBytes: Int64
+        var totalBytesExpected: Int64
+    }
+    
     // Directory on Group
     @objc let appDatabaseNextcloud                  = "Library/Application Support/Nextcloud"
     @objc let appApplicationSupport                 = "Library/Application Support"