marinofaggiana 4 년 전
부모
커밋
2873379751
4개의 변경된 파일6개의 추가작업 그리고 18개의 파일을 삭제
  1. 3 3
      File Provider Extension/FileProviderData.swift
  2. 1 3
      Share/NCSelectDestination.m
  3. 0 1
      iOSClient/AppDelegate.m
  4. 2 11
      iOSClient/Networking/NCNetworking.swift

+ 3 - 3
File Provider Extension/FileProviderData.swift

@@ -84,7 +84,7 @@ class fileProviderData: NSObject {
             homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
             
             NCCommunicationCommon.sharedInstance.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, nextcloudVersion: capabilities.versionMajor, delegate: NCNetworking.sharedInstance)
-            NCNetworking.sharedInstance.setup(account: tableAccount.account, delegate: providerExtension as? NCNetworkingDelegate)
+            NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
             
             return true
         }
@@ -107,7 +107,7 @@ class fileProviderData: NSObject {
                 homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
                 
                 NCCommunicationCommon.sharedInstance.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, nextcloudVersion: capabilities.versionMajor, delegate: NCNetworking.sharedInstance)
-                NCNetworking.sharedInstance.setup(account: tableAccount.account, delegate: providerExtension as? NCNetworkingDelegate)
+                NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
 
                 foundAccount = true
             }
@@ -136,7 +136,7 @@ class fileProviderData: NSObject {
                 homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
                 
                 NCCommunicationCommon.sharedInstance.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, nextcloudVersion: capabilities.versionMajor, delegate: NCNetworking.sharedInstance)
-                NCNetworking.sharedInstance.setup(account: tableAccount.account, delegate: providerExtension as? NCNetworkingDelegate)
+                NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
                 
                 foundAccount = true
             }

+ 1 - 3
Share/NCSelectDestination.m

@@ -53,9 +53,7 @@
         
         activeAccount = tableAccount.account;
         activeUrl = tableAccount.url;
-        
-        [[NCNetworking sharedInstance] setupWithAccount:activeAccount delegate:nil];
-        
+                
     } else {
         
         UIAlertController * alert= [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"_no_active_account_", nil) preferredStyle:UIAlertControllerStyleAlert];

+ 0 - 1
iOSClient/AppDelegate.m

@@ -434,7 +434,6 @@
     self.activePassword = activePassword;
     tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:activeAccount];
 
-    [[NCNetworking sharedInstance] setupWithAccount:activeAccount delegate:nil];
     (void)[NCNetworkingNotificationCenter shared];
 
     [[NCCommunicationCommon sharedInstance] setupWithUser:activeUser userId:activeUserID password:activePassword url:activeUrl userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups nextcloudVersion:capabilities.versionMajor delegate:[NCNetworking sharedInstance]];

+ 2 - 11
iOSClient/Networking/NCNetworking.swift

@@ -37,19 +37,10 @@ import NCCommunication
         let instance = NCNetworking()
         return instance
     }()
-    
-    var account = ""
-    
+        
     // Protocol
     var delegate: NCNetworkingDelegate?
-    
-    //MARK: - Setup
-    
-    @objc public func setup(account: String, delegate: NCNetworkingDelegate?) {
-        self.account = account
-        self.delegate = delegate
-    }
-    
+        
     //MARK: - Communication Delegate
        
     func authenticationChallenge(_ challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {