Skip to content

Commit

Permalink
Perform extraction in block on background queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
dempseyatgithub committed Feb 7, 2015
1 parent 121dd14 commit cd01fe6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions BuildSettingExtractor/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ - (IBAction)handleDroppedFile:(DragFileView *)sender {
if (result == NSModalResponseOK) {
NSURL *destinationURL = openPanel.URL;

BuildSettingExtractor *buildSettingExtractor = [[BuildSettingExtractor alloc] init];
buildSettingExtractor.includeBuildSettingInfoComments = [[NSUserDefaults standardUserDefaults] boolForKey:TPSIncludeBuildSettingInfoComments];

[buildSettingExtractor extractBuildSettingsFromProject:fileURL toDestinationFolder:destinationURL];

BOOL openInFinder = [[NSUserDefaults standardUserDefaults] boolForKey:TPSOpenDirectoryInFinder];
if (openInFinder) {
[[NSWorkspace sharedWorkspace] openURL:destinationURL];
}
// Perform the extraction in the background.
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
BuildSettingExtractor *buildSettingExtractor = [[BuildSettingExtractor alloc] init];
buildSettingExtractor.includeBuildSettingInfoComments = [[NSUserDefaults standardUserDefaults] boolForKey:TPSIncludeBuildSettingInfoComments];

[buildSettingExtractor extractBuildSettingsFromProject:fileURL toDestinationFolder:destinationURL];

BOOL openInFinder = [[NSUserDefaults standardUserDefaults] boolForKey:TPSOpenDirectoryInFinder];
if (openInFinder) {
[[NSWorkspace sharedWorkspace] openURL:destinationURL];
}
});
}

}];
}
}
Expand Down

0 comments on commit cd01fe6

Please sign in to comment.