marinofaggiana 4 سال پیش
والد
کامیت
d07c5251cb

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -819,7 +819,6 @@
 		F70211F31BAC56E9003FC03E /* Main */ = {
 			isa = PBXGroup;
 			children = (
-				F7CA213725F1372B00826ABB /* Account Request */,
 				F710D1FA24057E5E00A6033D /* ActionSheetHeaderView */,
 				F702F2E325EE5C82008F8E80 /* AudioRecorder */,
 				F7DFB7E9219C5A0500680748 /* Create cloud */,
@@ -1447,6 +1446,7 @@
 				F7C1CDD91E6DFC6F005D92BE /* Brand */,
 				F70211F31BAC56E9003FC03E /* Main */,
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
+				F7CA213725F1372B00826ABB /* Account Request */,
 				F7A321621E9E37960069AD1B /* Activity */,
 				F7AE00F6230E8191007ACF8A /* BrowserWeb */,
 				F7BAAD951ED5A63D00B7EAD4 /* Data */,

+ 0 - 0
iOSClient/Main/Account Request/NCAccountRequest.storyboard → iOSClient/Account Request/NCAccountRequest.storyboard


+ 0 - 0
iOSClient/Main/Account Request/NCAccountRequest.swift → iOSClient/Account Request/NCAccountRequest.swift


+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -242,7 +242,7 @@ import Queuer
         }
     }
     
-    func cancelAllTask() {
+    @objc func cancelAllTask() {
         NCCommunication.shared.getSessionManager().getAllTasks  { tasks in
             for task in tasks {
                 task.cancel()

+ 9 - 3
iOSClient/Networking/NCService.swift

@@ -83,9 +83,15 @@ class NCService: NSObject {
                             DispatchQueue.global().async {
                                 
                                 if let image = UIImage(data: data!) {
-                                    try? FileManager.default.removeItem(atPath: fileNamePath)
-                                    if let data = image.pngData() {
-                                        try? data.write(to: URL(fileURLWithPath: fileNamePath))
+                                    
+                                    NCUtilityFileSystem.shared.deleteFile(filePath: fileNamePath)
+                                    
+                                    do {
+                                        if let data = image.pngData() {
+                                            try data.write(to: URL(fileURLWithPath: fileNamePath))
+                                        }
+                                    } catch {
+                                        print(error)
                                     }
                                 }
                             }

+ 2 - 1
iOSClient/Settings/CCAdvanced.m

@@ -353,7 +353,8 @@
 {
     [[NCNetworking shared] cancelAllTransferWithAccount:appDelegate.account completion:^{ }];
     [[NCOperationQueue shared] cancelAllQueue];
-
+    [[NCNetworking shared] cancelAllTask];
+    
     [[NSURLCache sharedURLCache] setMemoryCapacity:0];
     [[NSURLCache sharedURLCache] setDiskCapacity:0];
     [KTVHTTPCache cacheDeleteAllCaches];

+ 3 - 0
iOSClient/Settings/CCManageAccount.m

@@ -482,6 +482,9 @@
     tableAccount *tableAccount = [[NCManageDatabase shared] setAccountActive:account];
     if (tableAccount) {
         
+        [[NCOperationQueue shared] cancelAllQueue];
+        [[NCNetworking shared] cancelAllTask];
+        
         [appDelegate settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userId:tableAccount.userId password:[CCUtility getPassword:tableAccount.account]];
  
         // Init home

+ 16 - 5
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -51,7 +51,9 @@ class NCUtilityFileSystem: NSObject {
         do {
             let attributes = try fileManager.attributesOfItem(atPath: filePath)
             return attributes[FileAttributeKey.size] as? Int64 ?? 0
-        } catch { }
+        } catch {
+            print(error)
+        }
         return 0
     }
     
@@ -60,7 +62,9 @@ class NCUtilityFileSystem: NSObject {
         do {
             let attributes = try fileManager.attributesOfItem(atPath: filePath)
             return attributes[FileAttributeKey.modificationDate] as? NSDate
-        } catch { }
+        } catch {
+            print(error)
+        }
         return nil
     }
     
@@ -69,7 +73,9 @@ class NCUtilityFileSystem: NSObject {
         do {
             let attributes = try fileManager.attributesOfItem(atPath: filePath)
             return attributes[FileAttributeKey.creationDate] as? NSDate
-        } catch { }
+        } catch {
+            print(error)
+        }
         return nil
     }
     
@@ -78,13 +84,16 @@ class NCUtilityFileSystem: NSObject {
         do {
             try FileManager.default.removeItem(at: fileURL)
         }
-        catch {}
+        catch {
+            print(error)
+        }
         
         do {
             try text.write(to: fileURL, atomically: true, encoding: .utf8)
             return true
         }
         catch {
+            print(error)
             return false
         }
     }
@@ -94,7 +103,9 @@ class NCUtilityFileSystem: NSObject {
         do {
             try FileManager.default.removeItem(atPath: filePath)
         }
-        catch {}
+        catch {
+            print(error)
+        }
     }
     
     @objc func moveFile(atPath: String, toPath: String) {