Skip to content

Commit cd01fe6

Browse files
Perform extraction in block on background queue.
1 parent 121dd14 commit cd01fe6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,19 @@ - (IBAction)handleDroppedFile:(DragFileView *)sender {
5757
if (result == NSModalResponseOK) {
5858
NSURL *destinationURL = openPanel.URL;
5959

60-
BuildSettingExtractor *buildSettingExtractor = [[BuildSettingExtractor alloc] init];
61-
buildSettingExtractor.includeBuildSettingInfoComments = [[NSUserDefaults standardUserDefaults] boolForKey:TPSIncludeBuildSettingInfoComments];
62-
63-
[buildSettingExtractor extractBuildSettingsFromProject:fileURL toDestinationFolder:destinationURL];
64-
65-
BOOL openInFinder = [[NSUserDefaults standardUserDefaults] boolForKey:TPSOpenDirectoryInFinder];
66-
if (openInFinder) {
67-
[[NSWorkspace sharedWorkspace] openURL:destinationURL];
68-
}
60+
// Perform the extraction in the background.
61+
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
62+
BuildSettingExtractor *buildSettingExtractor = [[BuildSettingExtractor alloc] init];
63+
buildSettingExtractor.includeBuildSettingInfoComments = [[NSUserDefaults standardUserDefaults] boolForKey:TPSIncludeBuildSettingInfoComments];
64+
65+
[buildSettingExtractor extractBuildSettingsFromProject:fileURL toDestinationFolder:destinationURL];
66+
67+
BOOL openInFinder = [[NSUserDefaults standardUserDefaults] boolForKey:TPSOpenDirectoryInFinder];
68+
if (openInFinder) {
69+
[[NSWorkspace sharedWorkspace] openURL:destinationURL];
70+
}
71+
});
6972
}
70-
7173
}];
7274
}
7375
}

0 commit comments

Comments
 (0)