Browse Source

improvements

marinofaggiana 5 years ago
parent
commit
9258aae5f4

+ 3 - 2
iOSClient/CCGlobal.h

@@ -334,9 +334,10 @@
 #define k_notificationCenter_reloadDataNCShare          @"reloadDataNCShare"
 #define k_notificationCenter_reloadDataNotification     @"reloadDataNotification"
 
-#define k_notificationCenter_uploadFileStart            @"uploadedFileStart"                // userInfo: ocId, uploadTask, serverUrl, account
+#define k_notificationCenter_uploadFileStart            @"uploadFileStart"                  // userInfo: ocId, uploadTask, serverUrl, account
 #define k_notificationCenter_uploadedFile               @"uploadedFile"                     // userInfo: metadata, errorCode, errorDescription
-#define k_notificationCenter_downloadFile               @"downloadFile"
+#define k_notificationCenter_downloadFileStart          @"downloadFileStart"                // userInfo: ocId, uploadTask, serverUrl, account
+#define k_notificationCenter_downloadedFile             @"downloadedFile"                   // userInfo: metadata, errorCode, errorDescription
 #define k_notificationCenter_progressTask               @"progressTask"
 
 #define k_notificationCenter_createFolder               @"createFolder"                     // userInfo: fileName, serverUrl, errorCode, errorDescription

+ 2 - 2
iOSClient/Main/NCDetailViewController.swift

@@ -59,7 +59,7 @@ class NCDetailViewController: UIViewController {
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(changeDisplayMode), name: NSNotification.Name(rawValue: k_notificationCenter_splitViewChangeDisplayMode), object: nil)
         
-        NotificationCenter.default.addObserver(self, selector: #selector(downloadFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_downloadFile), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(downloadedFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_downloadedFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(deleteFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_deleteFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(renameFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_renameFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_moveFile), object: nil)
@@ -315,7 +315,7 @@ class NCDetailViewController: UIViewController {
         }
     }
     
-    @objc func downloadFile(_ notification: NSNotification) {
+    @objc func downloadedFile(_ notification: NSNotification) {
         if self.view?.window == nil { return }
         
         if let userInfo = notification.userInfo as NSDictionary? {

+ 1 - 1
iOSClient/Networking/CCNetworking.m

@@ -591,7 +591,7 @@
     
     // NSNotificationCenter
     NSDictionary* userInfo = @{@"metadata": metadata, @"errorCode": @(errorCode), @"errorDescription": errorMessage};
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_downloadFile object:nil userInfo:userInfo];
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_downloadedFile object:nil userInfo:userInfo];
 }
 
 #pragma --------------------------------------------------------------------------------------------