Browse Source

Optimizzation

Marino Faggiana 8 years ago
parent
commit
1fbe7444a6
3 changed files with 10 additions and 0 deletions
  1. 1 0
      iOSClient/Main/CCMain.m
  2. 4 0
      iOSClient/Offline/CCOffline.m
  3. 5 0
      iOSClient/Offline/CCOfflineFolder.m

+ 1 - 0
iOSClient/Main/CCMain.m

@@ -1835,6 +1835,7 @@
     // Offline Folder
     // Offline Folder
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
         
         
+        // File is changed ??
         [[CCOfflineFolder sharedOfflineFolder] verifyChangeMedatas:metadatas serverUrl:metadataNet.serverUrl directoryID:metadataNet.directoryID account:app.activeAccount offline:NO];
         [[CCOfflineFolder sharedOfflineFolder] verifyChangeMedatas:metadatas serverUrl:metadataNet.serverUrl directoryID:metadataNet.directoryID account:app.activeAccount offline:NO];
     });
     });
 
 

+ 4 - 0
iOSClient/Offline/CCOffline.m

@@ -337,6 +337,10 @@
         NSString *serverUrl = [CCCoreData getServerUrlFromDirectoryID:metadata.directoryID activeAccount:app.activeAccount];
         NSString *serverUrl = [CCCoreData getServerUrlFromDirectoryID:metadata.directoryID activeAccount:app.activeAccount];
         if (serverUrl == nil) continue;
         if (serverUrl == nil) continue;
         
         
+        // if this file is on folder offline skip
+        if ([CCCoreData isOfflineDirectory:serverUrl activeAccount:app.activeAccount])
+            continue;
+
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         
         metadataNet.action = actionReadFile;
         metadataNet.action = actionReadFile;

+ 5 - 0
iOSClient/Offline/CCOfflineFolder.m

@@ -258,6 +258,11 @@
         
         
         if (offline) {
         if (offline) {
             
             
+            // add flag offline
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [CCCoreData addOffline:metadata.fileID activeAccount:app.activeAccount];
+            });
+            
             if (![record.rev isEqualToString:metadata.rev ])
             if (![record.rev isEqualToString:metadata.rev ])
                 changeRev = YES;
                 changeRev = YES;