Skip to content

Commit

Permalink
Run main thread blocks from a background thread
Browse files Browse the repository at this point in the history
  • Loading branch information
pjrobertson committed Jan 8, 2013
1 parent e805256 commit 98a7a03
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Quicksilver/Code-App/QSCatalogPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,19 @@ - (IBAction)setValueForSenderForCatalogEntry:(id)sender {
}

- (void)catalogChanged:(NSNotification *)notification {
dispatch_async(dispatch_get_main_queue(), ^{
[itemTable reloadData];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
[itemTable reloadData];
});
});
}

- (void)catalogIndexed:(NSNotification *)notification {
dispatch_sync(dispatch_get_main_queue(), ^{
[itemContentsTable reloadData];
[itemTable reloadData];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[itemContentsTable reloadData];
[itemTable reloadData];
});
});
}

Expand Down

0 comments on commit 98a7a03

Please sign in to comment.