Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Perform scanning on a background queue so that the GUI doesn't lock at startup. #1339

Merged
merged 1 commit into from

2 participants

@tiennou
Owner

No description provided.

@pjrobertson
Owner

Note to self: using __block on iVar is pointless

@pjrobertson pjrobertson merged commit 914ddce into quicksilver:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 21, 2013
  1. @tiennou
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 18 deletions.
  1. +20 −18 Quicksilver/Code-QuickStepCore/QSLibrarian.m
View
38 Quicksilver/Code-QuickStepCore/QSLibrarian.m
@@ -539,25 +539,27 @@ - (void)scanCatalogIgnoringIndexes:(BOOL)force {
return;
}
- @autoreleasepool {
- [scanTask setStatus:@"Catalog Rescan"];
- [scanTask startTask:self];
- [scanTask setProgress:-1];
- scannerCount++;
- NSArray *children = [catalog deepChildrenWithGroups:NO leaves:YES disabled:NO];
- NSUInteger i;
- NSUInteger c = [children count];
- for (i = 0; i<c; i++) {
- [scanTask setProgress:(CGFloat) i/c];
- [[children objectAtIndex:i] scanForced:force];
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
+ @autoreleasepool {
+ [scanTask setStatus:@"Catalog Rescan"];
+ [scanTask startTask:self];
+ [scanTask setProgress:-1];
+ scannerCount++;
+ NSArray *children = [catalog deepChildrenWithGroups:NO leaves:YES disabled:NO];
+ NSUInteger i;
+ NSUInteger c = [children count];
+ for (i = 0; i<c; i++) {
+ [scanTask setProgress:(CGFloat) i/c];
+ [[children objectAtIndex:i] scanForced:force];
+ }
+
+ [scanTask setProgress:1.0];
+ [scanTask stopTask:self];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:QSCatalogIndexingCompleted object:nil];
+ scannerCount--;
}
-
- [scanTask setProgress:1.0];
- [scanTask stopTask:self];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:QSCatalogIndexingCompleted object:nil];
- scannerCount--;
- }
+ });
}
Something went wrong with that request. Please try again.