Skip to content

Commit 5786bf9

Browse files
Remove temporary ENCLOSING_DESTINATION_FOLDER_ENABLED flag
1 parent 69af33e commit 5786bf9

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
// During development it is useful to turn off the overwrite checking
1616
#define OVERWRITE_CHECKING_DISABLED 0
1717

18-
// Temporary flag until the preference pane is updated
19-
#define ENCLOSING_DESTINATION_FOLDER_ENABLED 1
20-
2118
@interface AppDelegate () <NSOpenSavePanelDelegate>
2219

2320
@property (weak) IBOutlet NSWindow *window;
@@ -73,7 +70,7 @@ - (void)processXcodeProjectAtURL:(NSURL *)fileURL {
7370
[fileURL getResourceValue:&typeIdentifier forKey:NSURLTypeIdentifierKey error:&error];
7471

7572
if (fileURL && [typeIdentifier isEqualToString:[NSString tps_projectBundleTypeIdentifier]]) {
76-
if (ENCLOSING_DESTINATION_FOLDER_ENABLED && [[NSUserDefaults standardUserDefaults] boolForKey:TPSAutosaveInProjectFolder]) {
73+
if ([[NSUserDefaults standardUserDefaults] boolForKey:TPSAutosaveInProjectFolder]) {
7774
NSURL *baseURL = [fileURL URLByDeletingLastPathComponent];
7875
NSURL *destinationURL = [self createValidatedDestinationURLForBaseURL:baseURL error:&error];
7976
if (!destinationURL) {
@@ -96,17 +93,12 @@ - (void)selectDestinationURLForSourceProject:(NSURL *)fileURL {
9693
openPanel.canChooseDirectories = YES;
9794
openPanel.canChooseFiles = NO;
9895
openPanel.allowedFileTypes = @[(NSString *)kUTTypeFolder];
99-
#if ENCLOSING_DESTINATION_FOLDER_ENABLED
100-
openPanel.message = [NSString stringWithFormat:@"Choose location to save configuration files. Configuration files for project\n%@’ will be saved in a folder named '%@'.", [fileURL lastPathComponent], [[NSUserDefaults standardUserDefaults] stringForKey:TPSDestinationFolderName]];
101-
#else
102-
openPanel.message = [NSString stringWithFormat:@"Choose location to save configuration files for project ‘%@’.", [fileURL lastPathComponent]];
103-
#endif
96+
openPanel.message = [NSString stringWithFormat:@"Choose location to save configuration files.\nConfiguration files for project ‘%@\nwill be saved in a folder named '%@'.", [fileURL lastPathComponent], [[NSUserDefaults standardUserDefaults] stringForKey:TPSDestinationFolderName]];
10497
openPanel.prompt = @"Choose";
10598

10699
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
107100

108101
if (result == NSModalResponseOK) {
109-
#if ENCLOSING_DESTINATION_FOLDER_ENABLED
110102
NSError *error = nil;
111103
NSURL *baseURL = openPanel.URL;
112104
NSURL *destinationURL = [self createValidatedDestinationURLForBaseURL:baseURL error: &error];
@@ -115,10 +107,6 @@ - (void)selectDestinationURLForSourceProject:(NSURL *)fileURL {
115107
[alert beginSheetModalForWindow:self.window completionHandler:nil];
116108
return;
117109
}
118-
#else
119-
NSError *error = nil;
120-
NSURL *destinationURL = openPanel.URL;
121-
#endif
122110

123111
BOOL validDestination = [BuildSettingExtractor validateDestinationFolder:destinationURL error:&error];
124112

0 commit comments

Comments
 (0)