Summary: | WebKitErrors.m: _initWithPluginErrorCode: does not set localizedDescription | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jeff Johnson <opendarwin> | ||||||
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.5 | ||||||||
URL: | http://content.eska.pl/streamplayers/eska_rock/ | ||||||||
Attachments: |
|
Description
Jeff Johnson
2009-06-22 20:23:32 PDT
Created attachment 31708 [details]
Patch
Comment on attachment 31708 [details] Patch > diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog > index c48775e..7091307 100644 > --- a/WebKit/mac/ChangeLog > +++ b/WebKit/mac/ChangeLog > @@ -1,3 +1,10 @@ > +2009-06-23 Jeff Johnson <opendarwin@lapcatsoftware.com> > + > + Reviewed by NOBODY (OOPS!). > + > + * Misc/WebKitErrors.m: > + (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): > + > 2009-06-20 Darin Adler <darin@apple.com> The ChangeLog should contain a link to the bug and it's title, along with a brief description of the change. See other entries in the file for an example. > Reviewed by Sam Weinig. > diff --git a/WebKit/mac/Misc/WebKitErrors.m b/WebKit/mac/Misc/WebKitErrors.m > index 5985d9a..303c426 100644 > --- a/WebKit/mac/Misc/WebKitErrors.m > +++ b/WebKit/mac/Misc/WebKitErrors.m > @@ -106,6 +106,11 @@ static NSMutableDictionary *descriptions = nil; > [[self class] _registerWebKitErrors]; > > NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init]; > + NSDictionary *descriptionsDict = [descriptions objectForKey:WebKitErrorDomain]; > + NSString *localizedDesc = descriptionsDict ? [descriptionsDict objectForKey:[NSNumber numberWithInt:code]] : nil; > + if (localizedDesc) { > + [userInfo setObject:localizedDesc forKey:NSLocalizedDescriptionKey]; > + } > if (contentURL) { > [userInfo setObject:contentURL forKey:@"NSErrorFailingURLKey"]; > #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) I mentioned a few style issues with this code on IRC: * Sending a message with an object return type to nil will return nil, so the ternary statement is not necessary * Abbreviating Description to Desc is inconsistent with the other variable name, and not something we typically do * We omit braces around a single-line if statement For easy reference, the WebKit coding style guidelines are at <http://webkit.org/coding/coding-style.html>. Besides the ChangeLog and style issues the change is good. If you can make these changes and resubmit the patch I'll happily throw an r+ on it for you. Created attachment 31713 [details]
Patch version 2
Revised to match style guidelines.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebKit/mac/ChangeLog M WebKit/mac/Misc/WebKitErrors.m Committed r45074 http://trac.webkit.org/changeset/45074 |