浏览代码

Optimizzation

Marino Faggiana 8 年之前
父节点
当前提交
1fbe7444a6
共有 3 个文件被更改,包括 10 次插入0 次删除
  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
     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];
     });
 

+ 4 - 0
iOSClient/Offline/CCOffline.m

@@ -337,6 +337,10 @@
         NSString *serverUrl = [CCCoreData getServerUrlFromDirectoryID:metadata.directoryID activeAccount:app.activeAccount];
         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];
         
         metadataNet.action = actionReadFile;

+ 5 - 0
iOSClient/Offline/CCOfflineFolder.m

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