marinofaggiana %!s(int64=4) %!d(string=hai) anos
pai
achega
77cd077bc7

+ 2 - 0
iOSClient/AppDelegate.h

@@ -33,6 +33,7 @@
 #import "CCLogin.h"
 
 @class NCFiles;
+@class NCRecent;
 @class CCMore;
 @class NCMedia;
 @class NCOffline;
@@ -92,6 +93,7 @@
 
 @property (nonatomic, retain) NCFiles *activeFiles;
 @property (nonatomic, retain) NCFavorite *activeFavorite;
+@property (nonatomic, retain) NCRecent *activeRecent;
 @property (nonatomic, retain) NCMedia *activeMedia;
 @property (nonatomic, retain) NCDetailViewController *activeDetail;
 @property (nonatomic, retain) NCTransfers *activeTransfers;

+ 2 - 14
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -329,13 +329,7 @@ import NCCommunication
                         self.dismiss(animated: true, completion: {
                             let metadata = NCManageDatabase.sharedInstance.createMetadata(account: self.appDelegate.account, fileName: fileName, ocId: CCUtility.createRandomString(12), serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url ?? "", contentType: result.contentType, livePhoto: false)
                             
-                            if self.appDelegate.activeViewController is NCFiles {
-                                (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
-                            } else if self.appDelegate.activeViewController is NCFavorite {
-                                (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
-                            } else if self.appDelegate.activeViewController is NCOffline {
-                                (self.appDelegate.activeViewController as! NCOffline).segue(metadata: metadata)
-                            }
+                            NCNetworkingNotificationCenter.shared.segueMetadata(metadata)
                         })
                     }
                     
@@ -357,13 +351,7 @@ import NCCommunication
                     
                         let metadata = NCManageDatabase.sharedInstance.createMetadata(account: self.appDelegate.account, fileName: (fileName as NSString).deletingPathExtension + "." + self.fileNameExtension, ocId: CCUtility.createRandomString(12), serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url!, contentType: "", livePhoto: false)
                     
-                        if self.appDelegate.activeViewController is NCFiles {
-                            (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
-                        } else if self.appDelegate.activeViewController is NCFavorite {
-                            (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
-                        } else if self.appDelegate.activeViewController is NCOffline {
-                            (self.appDelegate.activeViewController as! NCOffline).segue(metadata: metadata)
-                        }
+                        NCNetworkingNotificationCenter.shared.segueMetadata(metadata)
                    })
                    
                     

+ 13 - 7
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -77,13 +77,7 @@ import Foundation
                                 
                             } else {
                                 
-                                if self.appDelegate.activeViewController is NCFiles {
-                                    (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
-                                } else if self.appDelegate.activeViewController is NCFavorite {
-                                    (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
-                                } else if self.appDelegate.activeViewController is NCOffline {
-                                    (self.appDelegate.activeViewController as! NCOffline).segue(metadata: metadata)
-                                }
+                                segueMetadata(metadata)
                             }
                         }
                         
@@ -180,6 +174,18 @@ import Foundation
         }
     }
     
+    @objc func segueMetadata(_ metadata: tableMetadata) {
+        if self.appDelegate.activeViewController is NCFiles {
+            (self.appDelegate.activeViewController as! NCFiles).segue(metadata: metadata)
+        } else if self.appDelegate.activeViewController is NCFavorite {
+            (self.appDelegate.activeViewController as! NCFavorite).segue(metadata: metadata)
+        } else if self.appDelegate.activeViewController is NCOffline {
+            (self.appDelegate.activeViewController as! NCOffline).segue(metadata: metadata)
+        } else if self.appDelegate.activeViewController is NCRecent {
+            (self.appDelegate.activeViewController as! NCRecent).segue(metadata: metadata)
+        }
+    }
+    
     //MARK: - Upload
 
     @objc func uploadedFile(_ notification: NSNotification) {

+ 1 - 0
iOSClient/Recent/NCRecent.swift

@@ -29,6 +29,7 @@ class NCRecent: NCCollectionViewCommon  {
     required init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)
         
+        appDelegate.activeRecent = self
         titleCurrentFolder = NSLocalizedString("_recent_", comment: "")
         layoutKey = k_layout_view_recent
         enableSearchBar = true