marinofaggiana 4 years ago
parent
commit
a7d3699f1c

+ 3 - 9
File Provider Extension/FileProviderData.swift

@@ -30,8 +30,6 @@ class fileProviderData: NSObject {
     }()
         
     var account = ""
-    var accountUser = ""
-    var accountUserID = ""
     var accountUrlBase = ""
     var homeServerUrl = ""
         
@@ -77,12 +75,10 @@ class fileProviderData: NSObject {
             let webDav = NCUtility.shared.getWebDAV(account: tableAccount.account)
             
             account = tableAccount.account
-            accountUser = tableAccount.user
-            accountUserID = tableAccount.userID
             accountUrlBase = tableAccount.urlBase
             homeServerUrl = NCUtility.shared.getHomeServer(urlBase: tableAccount.urlBase, account: tableAccount.account)
                         
-            NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: CCUtility.getPassword(tableAccount.account), urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+            NCCommunicationCommon.shared.setup(account: tableAccount.account, user: tableAccount.user, userId: tableAccount.userID, password: CCUtility.getPassword(tableAccount.account), urlBase: tableAccount.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
             NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
             
             return true
@@ -101,12 +97,10 @@ class fileProviderData: NSObject {
                 let webDav = NCUtility.shared.getWebDAV(account: tableAccount.account)
                 
                 account = tableAccount.account
-                accountUser = tableAccount.user
-                accountUserID = tableAccount.userID
                 accountUrlBase = tableAccount.urlBase
                 homeServerUrl = NCUtility.shared.getHomeServer(urlBase: tableAccount.urlBase, account: tableAccount.account)
                 
-                NCCommunicationCommon.shared.setup(account: account, user: accountUser, userId: accountUserID, password: CCUtility.getPassword(tableAccount.account), urlBase: accountUrlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+                NCCommunicationCommon.shared.setup(account: tableAccount.account, user: tableAccount.user, userId: tableAccount.userID, password: CCUtility.getPassword(tableAccount.account), urlBase: tableAccount.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
                 NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
 
                 foundAccount = true
@@ -115,7 +109,7 @@ class fileProviderData: NSObject {
         
         return foundAccount
     }
-    
+        
     // MARK: -
 
     @discardableResult

+ 1 - 1
File Provider Extension/FileProviderExtension+Actions.swift

@@ -264,7 +264,7 @@ extension FileProviderExtension {
         }
         
         if (favorite == true && metadata.favorite == false) || (favorite == false && metadata.favorite == true) {
-            let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: fileProviderData.sharedInstance.accountUrlBase, account: metadata.account)!
+            let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, account: metadata.account)!
             
             // NCCommunication
             if fileProviderData.sharedInstance.setupAccount(domain: domain?.identifier.rawValue, providerExtension: self) == false {

+ 1 - 1
File Provider Extension/FileProviderExtension+Thumbnail.swift

@@ -41,7 +41,7 @@ extension FileProviderExtension {
             
             if (metadata.hasPreview) {
                 
-                let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: fileProviderData.sharedInstance.accountUrlBase, account: metadata.account)!
+                let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, account: metadata.account)!
                 let fileNameIconLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)!
                     
                 // NCCommunication