adium 3351:ec148a7d0c62: Fix previous commit: wrap the call to -...
commits at adium.im
commits at adium.im
Tue Oct 5 13:55:18 UTC 2010
details: http://hg.adium.im/adium/rev/ec148a7d0c62
revision: 3351:ec148a7d0c62
author: Thijs Alkemade <thijsalkemade at gmail.com>
date: Tue Oct 05 15:54:36 2010 +0200
Fix previous commit: wrap the call to -_setLocalStorageDatabasePath: so we don't break if WebKit's API changes, and register our protocol only once.
diffs (46 lines):
diff -r 2b9eb5aee00b -r ec148a7d0c62 Plugins/WebKit Message View/AIWebKitDelegate.m
--- a/Plugins/WebKit Message View/AIWebKitDelegate.m Tue Oct 05 01:02:56 2010 +0200
+++ b/Plugins/WebKit Message View/AIWebKitDelegate.m Tue Oct 05 15:54:36 2010 +0200
@@ -10,6 +10,7 @@
#import "ESWebView.h"
#import "AIURLHandlerPlugin.h"
#import "AIEventAdditions.h"
+#import "AIAdiumURLProtocol.h"
static AIWebKitDelegate *AISharedWebKitDelegate;
@@ -23,6 +24,9 @@
{
if ((self = [super init])) {
mapping = [[NSMutableDictionary alloc] init];
+
+ [NSURLProtocol registerClass:[AIAdiumURLProtocol class]];
+ [ESWebView registerURLSchemeAsLocal:@"adium"];
}
return self;
}
diff -r 2b9eb5aee00b -r ec148a7d0c62 Plugins/WebKit Message View/ESWebView.m
--- a/Plugins/WebKit Message View/ESWebView.m Tue Oct 05 01:02:56 2010 +0200
+++ b/Plugins/WebKit Message View/ESWebView.m Tue Oct 05 15:54:36 2010 +0200
@@ -15,7 +15,6 @@
*/
#import "ESWebView.h"
-#import "AIAdiumURLProtocol.h"
#import <Adium/AILoginControllerProtocol.h>
@interface WebView ()
@@ -45,10 +44,9 @@
shouldForwardEvents = YES;
transparentBackground = NO;
- [NSURLProtocol registerClass:[AIAdiumURLProtocol class]];
- [ESWebView registerURLSchemeAsLocal:@"adium"];
-
- [[self preferences] _setLocalStorageDatabasePath:[[adium.loginController userDirectory] stringByAppendingPathComponent:@"LocalStorage"]];
+ if ([[self preferences] respondsToSelector:@selector(_setLocalStorageDatabasePath:)]) {
+ [[self preferences] _setLocalStorageDatabasePath:[[adium.loginController userDirectory] stringByAppendingPathComponent:@"LocalStorage"]];
+ }
}
return self;
More information about the commits
mailing list