Changeset 84191 in webkit


Ignore:
Timestamp:
Apr 18, 2011 3:20:03 PM (13 years ago)
Author:
cwzwarich@webkit.org
Message:

Reviewed by Timothy Hatcher.

Stop using -[NSString initWithContentsOfFile:]
https://bugs.webkit.org/show_bug.cgi?id=58763

-[NSString initWithContentsOfFile:] was deprecated in 10.4, so we should stop using it.

  • WebView/WebView.mm:

(leakMailQuirksUserScriptContents):
(leakOutlookQuirksUserScriptContents):

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r84120 r84191  
     12011-04-17  Cameron Zwarich  <zwarich@apple.com>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Stop using -[NSString initWithContentsOfFile:]
     6        https://bugs.webkit.org/show_bug.cgi?id=58763
     7
     8        -[NSString initWithContentsOfFile:] was deprecated in 10.4, so we should stop using it.
     9
     10        * WebView/WebView.mm:
     11        (leakMailQuirksUserScriptContents):
     12        (leakOutlookQuirksUserScriptContents):
     13
    1142011-04-17  David Kilzer  <ddkilzer@apple.com>
    215
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r84120 r84191  
    644644{
    645645    NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"];
    646     return [[NSString alloc] initWithContentsOfFile:scriptPath];
     646    NSStringEncoding encoding;
     647    return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0];
    647648}
    648649
     
    664665{
    665666    NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"OutlookQuirksUserScript" ofType:@"js"];
    666     return [[NSString alloc] initWithContentsOfFile:scriptPath];
     667    NSStringEncoding encoding;
     668    return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0];
    667669}
    668670
Note: See TracChangeset for help on using the changeset viewer.