marinofaggiana %!s(int64=5) %!d(string=hai) anos
pai
achega
fade017f80

+ 1 - 1
iOSClient/Activity/NCActivity.swift

@@ -342,7 +342,7 @@ extension activityTableViewCell: UICollectionViewDelegate {
             if (responder as? UIViewController)!.navigationController != nil {
                 if let viewController = UIStoryboard.init(name: "NCTrash", bundle: nil).instantiateInitialViewController() as? NCTrash {
                     if let result = NCManageDatabase.sharedInstance.getTrashItem(ocId: String(activityPreview.fileId), account: activityPreview.account) {
-                        viewController.blinkocId = result.ocId
+                        viewController.blinkocId = result.fileId
                         viewController.path = result.filePath
                         (responder as? UIViewController)!.navigationController?.pushViewController(viewController, animated: true)
                     } else {

+ 1 - 1
iOSClient/CCGlobal.h

@@ -81,7 +81,7 @@
 
 // Database Realm
 #define k_databaseDefault                               @"nextcloud.realm"
-#define k_databaseSchemaVersion                         73
+#define k_databaseSchemaVersion                         74
 
 // Intro selector
 #define k_intro_login                                   0

+ 2 - 2
iOSClient/Database/NCDatabase.swift

@@ -472,7 +472,7 @@ class tableTrash: Object {
     @objc dynamic var account = ""
     @objc dynamic var date = NSDate()
     @objc dynamic var directory: Bool = false
-    @objc dynamic var ocId = ""
+    @objc dynamic var fileId = ""
     @objc dynamic var fileName = ""
     @objc dynamic var filePath = ""
     @objc dynamic var hasPreview: Bool = false
@@ -484,6 +484,6 @@ class tableTrash: Object {
     @objc dynamic var trashbinDeletionTime = NSDate()
 
     override static func primaryKey() -> String {
-        return "ocId"
+        return "fileId"
     }
 }

+ 3 - 2
iOSClient/Database/NCManageDatabase.swift

@@ -63,14 +63,14 @@ class NCManageDatabase: NSObject {
                     migration.deleteData(forType: tableShare.className())
                 }
                 
-                if oldSchemaVersion < 73 {
+                if oldSchemaVersion < 74 {
                     
                     migration.enumerateObjects(ofType: tableLocalFile.className()) { oldObject, newObject in
                         newObject!["ocId"] = oldObject!["fileID"]
                     }
                     
                     migration.enumerateObjects(ofType: tableTrash.className()) { oldObject, newObject in
-                        newObject!["ocId"] = oldObject!["fileID"]
+                        newObject!["fileId"] = oldObject!["fileID"]
                     }
                     
                     migration.enumerateObjects(ofType: tableTag.className()) { oldObject, newObject in
@@ -85,6 +85,7 @@ class NCManageDatabase: NSObject {
                     migration.deleteData(forType: tableActivityPreview.className())
                     migration.deleteData(forType: tableActivitySubjectRich.className())
                     migration.deleteData(forType: tableComments.className())
+                    migration.deleteData(forType: tableDirectory.className())
                     migration.deleteData(forType: tableMetadata.className())
                     migration.deleteData(forType: tableE2eEncryptionLock.className())
                     migration.deleteData(forType: tableTag.className())

+ 4 - 15
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -1373,21 +1373,10 @@ NSString *const NCResource = @"<d:displayname/>"
     NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
     
     [request setValue: depth forHTTPHeaderField: @"Depth"];
-    NSString *body = [NSString stringWithFormat: @""
-                      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-                      "<D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
-                      "<D:prop>"
-                      "<D:resourcetype/>"
-                      "<D:getlastmodified/>"
-                      "<id xmlns=\"http://owncloud.org/ns\"/>"
-                      "<D:getcontentlength/>"
-                      "<nc:trashbin-filename/>"
-                      "<nc:trashbin-original-location/>"
-                      "<nc:trashbin-deletion-time/>"
-                      "<nc:has-preview/>"
-                      "</D:prop>"
-                      "</D:propfind>"];
-
+    
+    NSString *body = @"<?xml version=\"1.0\" encoding=\"UTF-8\"?><d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><d:prop>";
+    body = [body stringByAppendingString:NCResource];
+    body = [body stringByAppendingString:@"</d:prop></d:propfind>"];
     [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     

+ 1 - 1
iOSClient/Networking/OCNetworking.m

@@ -2570,7 +2570,7 @@
                     trash.account = account;
                     trash.date = [NSDate dateWithTimeIntervalSince1970:itemDto.date];
                     trash.directory = itemDto.isDirectory;
-                    trash.ocId = itemDto.ocId;
+                    trash.fileId = itemDto.fileId;
                     trash.fileName = itemDto.fileName;
                     NSArray *array = [itemDto.filePath componentsSeparatedByString:path];
                     long len = [[array objectAtIndex:0] length];

+ 15 - 25
iOSClient/Settings/CCAdvanced.m

@@ -289,33 +289,23 @@
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
         
-        [self.hud visibleIndeterminateHud];
+        [[CCNetworking sharedNetworking] invalidateAndCancelAllSession];
         
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-            
-            [[CCNetworking sharedNetworking] invalidateAndCancelAllSession];
-            
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-                
-                [[NSURLCache sharedURLCache] setMemoryCapacity:0];
-                [[NSURLCache sharedURLCache] setDiskCapacity:0];
-                [KTVHTTPCache cacheDeleteAllCaches];
+        [[NSURLCache sharedURLCache] setMemoryCapacity:0];
+        [[NSURLCache sharedURLCache] setDiskCapacity:0];
+        [KTVHTTPCache cacheDeleteAllCaches];
 
-                [[NCManageDatabase sharedInstance] removeDB];
-                
-                [CCUtility emptyGroupDirectoryProviderStorage];
-                [CCUtility emptyGroupApplicationSupport];
-                
-                [CCUtility emptyDocumentsDirectory];
-                [CCUtility emptyTemporaryDirectory];
-                
-                [CCUtility deleteAllChainStore];
-            });
-            
-            [self.hud hideHud];
-            
-            exit(0);
-        });
+        [CCUtility emptyGroupDirectoryProviderStorage];
+        [CCUtility emptyGroupApplicationSupport];
+        
+        [CCUtility emptyDocumentsDirectory];
+        [CCUtility emptyTemporaryDirectory];
+        
+        [CCUtility deleteAllChainStore];
+        
+        [[NCManageDatabase sharedInstance] removeDB];
+        
+        exit(0);
     }]];
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

+ 13 - 13
iOSClient/Trash/NCTrash.swift

@@ -285,7 +285,7 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
                 return
             }
             
-            let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: tableTrash.directory, iconName: tableTrash.iconName, ocId: tableTrash.ocId, fileNameView: tableTrash.fileName, text: tableTrash.trashbinFileName)            
+            let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: tableTrash.directory, iconName: tableTrash.iconName, ocId: tableTrash.fileId, fileNameView: tableTrash.fileName, text: tableTrash.trashbinFileName)
             actionSheet?.headerView = headerView
             actionSheet?.headerView?.frame.size.height = 50
             
@@ -320,7 +320,7 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
                 return
             }
             
-            let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: tableTrash.directory, iconName: tableTrash.iconName, ocId: tableTrash.ocId, fileNameView: tableTrash.fileName, text: tableTrash.trashbinFileName)
+            let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: tableTrash.directory, iconName: tableTrash.iconName, ocId: tableTrash.fileId, fileNameView: tableTrash.fileName, text: tableTrash.trashbinFileName)
             actionSheet?.headerView = headerView
             actionSheet?.headerView?.frame.size.height = 50
             
@@ -472,10 +472,10 @@ extension NCTrash: UICollectionViewDelegate {
         let tableTrash = datasource[indexPath.item]
         
         if isEditMode {
-            if let index = selectocId.firstIndex(of: tableTrash.ocId) {
+            if let index = selectocId.firstIndex(of: tableTrash.fileId) {
                 selectocId.remove(at: index)
             } else {
-                selectocId.append(tableTrash.ocId)
+                selectocId.append(tableTrash.fileId)
             }
             collectionView.reloadItems(at: [indexPath])
             return
@@ -543,10 +543,10 @@ extension NCTrash: UICollectionViewDataSource {
             image = UIImage.init(named: "file")
         }
         
-        if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.ocId, fileNameView: tableTrash.fileName)) {
-            image = UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.ocId, fileNameView: tableTrash.fileName))
+        if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, fileNameView: tableTrash.fileName)) {
+            image = UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, fileNameView: tableTrash.fileName))
         } else {
-            if tableTrash.hasPreview && !CCUtility.fileProviderStorageIconExists(tableTrash.ocId, fileNameView: tableTrash.fileName) {
+            if tableTrash.hasPreview && !CCUtility.fileProviderStorageIconExists(tableTrash.fileId, fileNameView: tableTrash.fileName) {
                 downloadThumbnail(with: tableTrash, indexPath: indexPath)
             }
         }
@@ -557,7 +557,7 @@ extension NCTrash: UICollectionViewDataSource {
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCTrashListCell
             cell.delegate = self
             
-            cell.ocId = tableTrash.ocId
+            cell.ocId = tableTrash.fileId
             cell.indexPath = indexPath
             cell.labelTitle.text = tableTrash.trashbinFileName
             
@@ -573,7 +573,7 @@ extension NCTrash: UICollectionViewDataSource {
                 cell.imageItemLeftConstraint.constant = 45
                 cell.imageSelect.isHidden = false
                 
-                if selectocId.contains(tableTrash.ocId) {
+                if selectocId.contains(tableTrash.fileId) {
                     cell.imageSelect.image = CCGraphics.scale(UIImage.init(named: "checkedYes"), to: CGSize(width: 50, height: 50), isAspectRation: true)
                     cell.backgroundView = NCUtility.sharedInstance.cellBlurEffect(with: cell.bounds)
                 } else {
@@ -594,7 +594,7 @@ extension NCTrash: UICollectionViewDataSource {
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
             cell.delegate = self
             
-            cell.ocId = tableTrash.ocId
+            cell.ocId = tableTrash.fileId
             cell.indexPath = indexPath
             cell.labelTitle.text = tableTrash.trashbinFileName
             
@@ -606,7 +606,7 @@ extension NCTrash: UICollectionViewDataSource {
             
             if isEditMode {
                 cell.imageSelect.isHidden = false
-                if selectocId.contains(tableTrash.ocId) {
+                if selectocId.contains(tableTrash.fileId) {
                     cell.imageSelect.image = CCGraphics.scale(UIImage.init(named: "checkedYes"), to: CGSize(width: 50, height: 50), isAspectRation: true)
                     cell.backgroundView = NCUtility.sharedInstance.cellBlurEffect(with: cell.bounds)
                 } else {
@@ -651,7 +651,7 @@ extension NCTrash {
             // GoTo ocId
             if self.blinkocId != nil {
                 for item in 0...self.datasource.count-1 {
-                    if self.datasource[item].ocId.contains(self.blinkocId!) {
+                    if self.datasource[item].fileId.contains(self.blinkocId!) {
                         let indexPath = IndexPath(item: item, section: 0)
                         self.collectionView.scrollToItem(at: indexPath, at: .top, animated: false)
                         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
@@ -747,7 +747,7 @@ extension NCTrash {
     
     func downloadThumbnail(with tableTrash: tableTrash, indexPath: IndexPath) {
         
-        OCNetworking.sharedManager().downloadPreviewTrash(withAccount: appDelegate.activeAccount, ocId: tableTrash.ocId, fileName: tableTrash.fileName, completion: { (account, image, message, errorCode) in
+        OCNetworking.sharedManager().downloadPreviewTrash(withAccount: appDelegate.activeAccount, ocId: tableTrash.fileId, fileName: tableTrash.fileName, completion: { (account, image, message, errorCode) in
             
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 if let cell = self.collectionView.cellForItem(at: indexPath) {