marinofaggiana 4 years ago
parent
commit
41c506e5f8

+ 0 - 5
iOSClient/CCGlobal.h

@@ -254,11 +254,6 @@
 #define k_trash_version_available                       14
 #define k_trash_version_available_more_fix              15
 
-// Cell Reload Data Source
-#define k_action_NULL                                   0
-#define k_action_MOD                                    1
-#define k_action_DEL                                    2
-
 // Toolbar Detail
 #define k_detail_Toolbar_Height                         49
 

+ 1 - 0
iOSClient/Main/CCMain.m

@@ -421,6 +421,7 @@
     } else {
         
         // reload datasource
+        
         [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:_serverUrl ocId:nil action:k_action_NULL];
     }
     

+ 0 - 2
iOSClient/Main/NCMainCommon.swift

@@ -149,7 +149,6 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
             NCNetworking.shared.cancelUpload(metadata: metadata)
         } else {
         
-            var actionReloadDatasource = k_action_NULL
             guard let session = CCNetworking.shared().getSessionfromSessionDescription(metadata.session) else { return }
             var metadata = metadata
 
@@ -175,7 +174,6 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                         catch { }
                         NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
                     }
-                    actionReloadDatasource = k_action_DEL
                 }
                 
                 DispatchQueue.main.asyncAfter(deadline: .now() + 1) {

+ 5 - 7
iOSClient/Share/NCSharePaging.swift

@@ -31,7 +31,7 @@ class NCSharePaging: UIViewController {
     private let pagingViewController = NCShareHeaderViewController()
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
-    @objc var metadata: tableMetadata?
+    @objc var metadata = tableMetadata()
     @objc var indexPage: Int = 0
     
     override func viewDidLoad() {
@@ -83,9 +83,7 @@ class NCSharePaging: UIViewController {
     override func viewWillDisappear(_ animated: Bool) {
         super.viewWillDisappear(animated)
         
-        appDelegate.activeMain?.reloadDatasource(self.appDelegate.activeMain?.serverUrl, ocId: nil, action: Int(k_action_NULL))
-        appDelegate.activeFavorites?.reloadDatasource(nil, action: Int(k_action_NULL))
-        appDelegate.activeOffline?.loadDatasource()
+        NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
     }
     
     @objc func exitTapped() {
@@ -133,17 +131,17 @@ extension NCSharePaging: PagingViewControllerDataSource {
             let viewController = UIStoryboard(name: "NCActivity", bundle: nil).instantiateInitialViewController() as! NCActivity
             viewController.insets = UIEdgeInsets(top: height - topSafeArea, left: 0, bottom: 0, right: 0)
             viewController.didSelectItemEnable = false
-            viewController.filterFileId = metadata!.fileId
+            viewController.filterFileId = metadata.fileId
             viewController.objectType = "files"
             return viewController
         case 1:
             let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "comments") as! NCShareComments
-            viewController.metadata = metadata!
+            viewController.metadata = metadata
             viewController.height = height
             return viewController
         case 2:
             let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "sharing") as! NCShare
-            viewController.metadata = metadata!
+            viewController.metadata = metadata
             viewController.height = height
             return viewController
         default: