From 994057ae2a82dc110a385ced4239ce49cc0601f8 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 17:20:18 +0100 Subject: Add cast for [NSApp delegate] * (Also changed some outdated URLs) * Replaced [NSApplication sharedApplication] with NSApp --- Source/SPBundleHTMLOutputController.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Source/SPBundleHTMLOutputController.m') diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index da82d768..ed1142a2 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -260,7 +260,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; [c displayHTMLContent:[NSString stringWithFormat:@"
%@
", [sourceCode HTMLEscapeString]] withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; } - (void)saveDocument @@ -294,7 +294,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; windowUUID = @""; docUUID = @""; - [[NSApp delegate] removeHTMLOutputController:self]; + [SPAppDelegate removeHTMLOutputController:self]; [self release]; } @@ -332,7 +332,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; if(request != nil) { SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init]; [c displayURLString:[[request URL] absoluteString] withOptions:nil]; - [[NSApp delegate] addHTMLOutputController:c]; + [SPAppDelegate addHTMLOutputController:c]; return [c webView]; } return nil; @@ -351,7 +351,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; // sequelpro:// handler if([[[request URL] scheme] isEqualToString:@"sequelpro"] && navigationType == WebNavigationTypeLinkClicked) { - [[NSApp delegate] handleEventWithURL:[request URL]]; + [SPAppDelegate handleEventWithURL:[request URL]]; [listener ignore]; } // sp-reveal-file://a_file_path reveals the file in Finder @@ -571,7 +571,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; */ - (NSString *)getShellEnvironmentForName:(NSString*)keyName { - return [[[NSApp delegate] shellEnvironmentForDocument:nil] objectForKey:keyName]; + return [[SPAppDelegate shellEnvironmentForDocument:nil] objectForKey:keyName]; } /** @@ -691,7 +691,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; output = [SPBundleCommandRunner runBashCommand:command withEnvironment:nil atCurrentDirectoryPath:nil error:&err]; else { NSMutableDictionary *theEnv = [NSMutableDictionary dictionary]; - [theEnv addEntriesFromDictionary:[[NSApp delegate] shellEnvironmentForDocument:nil]]; + [theEnv addEntriesFromDictionary:[SPAppDelegate shellEnvironmentForDocument:nil]]; [theEnv setObject:uuid forKey:SPBundleShellVariableProcessID]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryInputPathHeader, uuid] forKey:SPBundleShellVariableQueryFile]; [theEnv setObject:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultPathHeader, uuid] forKey:SPBundleShellVariableQueryResultFile]; @@ -701,7 +701,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; output = [SPBundleCommandRunner runBashCommand:command withEnvironment:theEnv atCurrentDirectoryPath:nil - callerInstance:[NSApp delegate] + callerInstance:SPAppDelegate contextInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JavaScript", @"name", NSLocalizedString(@"General", @"general menu item label"), @"scope", -- cgit v1.2.3 From e201531daa71ee1a2e2a0f927c619947126c9d3d Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 4 Jan 2015 21:15:43 +0100 Subject: Addition to commit 2735e15b --- Source/SPBundleHTMLOutputController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/SPBundleHTMLOutputController.m') diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index ed1142a2..16a2f9da 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -126,7 +126,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; - (void)dealloc { - if(webPreferences) [webPreferences release]; + if(webPreferences) SPClear(webPreferences); [super dealloc]; } -- cgit v1.2.3