diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2013-07-07 07:53:08 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2013-07-07 07:53:08 (GMT) |
commit | 4e327c9d1cd8f7c7abbc5b9fa4384a801ff3fe59 (patch) | |
tree | 86c7d6e4381d92af59f8df4ec9faaf74a1f2f11a /Mac/PythonLauncher/MyDocument.m | |
parent | 385521c90e35565ceb1bc54ab31b217321fd2d84 (diff) | |
download | cpython-4e327c9d1cd8f7c7abbc5b9fa4384a801ff3fe59.zip cpython-4e327c9d1cd8f7c7abbc5b9fa4384a801ff3fe59.tar.gz cpython-4e327c9d1cd8f7c7abbc5b9fa4384a801ff3fe59.tar.bz2 |
Issue #18377: Code cleanup in Python Launcher
This changeset fixes a number of compiler warnings in the Python Launcher
binary for OSX. It also cleans up whitespace usage in those sources.
Diffstat (limited to 'Mac/PythonLauncher/MyDocument.m')
-rwxr-xr-x | Mac/PythonLauncher/MyDocument.m | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Mac/PythonLauncher/MyDocument.m b/Mac/PythonLauncher/MyDocument.m index 8f851e7..90c5db9 100755 --- a/Mac/PythonLauncher/MyDocument.m +++ b/Mac/PythonLauncher/MyDocument.m @@ -16,7 +16,7 @@ { self = [super init]; if (self) { - + // Add your subclass-specific initialization here. // If an error occurs here, send a [self dealloc] message and return nil. script = [@"<no script>.py" retain]; @@ -37,20 +37,17 @@ { NSApplication *app = [NSApplication sharedApplication]; [super close]; - if ([[app delegate] shouldTerminate]) + if ([(MyAppDelegate*)[app delegate] shouldTerminate]) [app terminate: self]; } - (void)load_defaults { -// if (settings) [settings release]; settings = [FileSettings newSettingsForFileType: filetype]; } - (void)update_display { -// [[self window] setTitle: script]; - [interpreter setStringValue: [settings interpreter]]; [honourhashbang setState: [settings honourhashbang]]; [debug setState: [settings debug]]; @@ -62,7 +59,7 @@ [others setStringValue: [settings others]]; [scriptargs setStringValue: [settings scriptargs]]; [with_terminal setState: [settings with_terminal]]; - + [commandline setStringValue: [settings commandLineForScript: script]]; } @@ -75,7 +72,7 @@ { const char *cmdline; int sts; - + cmdline = [[settings commandLineForScript: script] UTF8String]; if ([settings with_terminal]) { sts = doscript(cmdline); @@ -107,14 +104,13 @@ { // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead. BOOL show_ui; - - // ask the app delegate whether we should show the UI or not. - show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI]; + + // ask the app delegate whether we should show the UI or not. + show_ui = [(MyAppDelegate*)[[NSApplication sharedApplication] delegate] shouldShowUI]; [script release]; script = [fileName retain]; [filetype release]; filetype = [type retain]; -// if (settings) [settings release]; settings = [FileSettings newSettingsForFileType: filetype]; if (show_ui) { [self update_display]; @@ -152,7 +148,7 @@ [self update_display]; } -// FileSettingsSource protocol +// FileSettingsSource protocol - (NSString *) interpreter { return [interpreter stringValue];}; - (BOOL) honourhashbang { return [honourhashbang state];}; - (BOOL) debug { return [debug state];}; |