Selaa lähdekoodia

clear cache fix

marinofaggiana 5 vuotta sitten
vanhempi
commit
3dfb6a31b9
1 muutettua tiedostoa jossa 19 lisäystä ja 29 poistoa
  1. 19 29
      iOSClient/Settings/CCAdvanced.m

+ 19 - 29
iOSClient/Settings/CCAdvanced.m

@@ -219,39 +219,29 @@
 {
     [appDelegate maintenanceMode:YES];
     
-    [self.hud visibleHudTitle:NSLocalizedString(@"_remove_cache_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
-    
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC),dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        [[NCMainCommon sharedInstance] cancelAllTransfer];
+    [[NCMainCommon sharedInstance] cancelAllTransfer];
 
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
+    [[NSURLCache sharedURLCache] setMemoryCapacity:0];
+    [[NSURLCache sharedURLCache] setDiskCapacity:0];
+    [KTVHTTPCache cacheDeleteAllCaches];
+    
+    [[NCManageDatabase sharedInstance] clearDatabaseWithAccount:appDelegate.activeAccount removeUser:false];
+    
+    [CCUtility emptyGroupDirectoryProviderStorage];
+    [CCUtility emptyGroupLibraryDirectory];
+    
+    [CCUtility emptyDocumentsDirectory];
+    [CCUtility emptyTemporaryDirectory];
+    
+    [CCUtility createDirectoryStandard];
 
-            [[NSURLCache sharedURLCache] setMemoryCapacity:0];
-            [[NSURLCache sharedURLCache] setDiskCapacity:0];
-            [KTVHTTPCache cacheDeleteAllCaches];
-            
-            [[NCManageDatabase sharedInstance] clearDatabaseWithAccount:appDelegate.activeAccount removeUser:false];
-            
-            [CCUtility emptyGroupDirectoryProviderStorage];
-            [CCUtility emptyGroupLibraryDirectory];
-            
-            [CCUtility emptyDocumentsDirectory];
-            [CCUtility emptyTemporaryDirectory];
-            
-            [CCUtility createDirectoryStandard];
+    [[NCAutoUpload sharedInstance] alignPhotoLibrary];
+    [appDelegate.filterocId removeAllObjects];
 
-            [[NCAutoUpload sharedInstance] alignPhotoLibrary];
-            [appDelegate.filterocId removeAllObjects];
+    [appDelegate maintenanceMode:NO];
 
-            [appDelegate maintenanceMode:NO];
-        
-            // Close HUD
-            [self.hud hideHud];
-            // Inizialized home
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
-        });
-    });
+    // Inizialized home
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
 }
 
 - (void)clearCacheRequest:(XLFormRowDescriptor *)sender