bugfix: we may have a case sensitive file system!
This commit is contained in:
parent
540ebcc78b
commit
1be48afc90
2 changed files with 18 additions and 9 deletions
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Webkit/Webkit.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "ViewDelegate.h"
|
||||
#import <Carbon/Carbon.h>
|
||||
#import "Constants.h"
|
||||
|
@ -81,6 +81,8 @@
|
|||
- (NSString *)stringForKey:(NSString *)aKey;
|
||||
- (void)loggedIn;
|
||||
|
||||
- (void)stringFromFile:(NSString *)file url: (NSURL **) url content: (NSString **) content;
|
||||
|
||||
- (IBAction)login:(id)sender;
|
||||
- (IBAction)logout:(id)sender;
|
||||
|
||||
|
|
|
@ -81,14 +81,20 @@
|
|||
|
||||
# pragma mark Init
|
||||
|
||||
|
||||
- (void)stringFromFile:(NSString *)file url: (NSURL **) url content: (NSString **) content
|
||||
{
|
||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingFormat: @"/WebKit/%@", file];
|
||||
*url = [NSURL fileURLWithPath: path];
|
||||
*content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
|
||||
}
|
||||
|
||||
- (void)initOauth
|
||||
{
|
||||
if (!oauthView) {
|
||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
||||
NSURL *url = [NSURL fileURLWithPath:path];
|
||||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
||||
NSString *index_string;
|
||||
NSURL *url;
|
||||
|
||||
[self stringFromFile: @"index.html" url: &url content: &index_string];
|
||||
|
||||
oauthView = [[WebView alloc] init];
|
||||
viewDelegate.oauthView = oauthView;
|
||||
|
@ -106,11 +112,12 @@
|
|||
|
||||
if (viewDelegate.timelineView != timelineView)
|
||||
{
|
||||
[self initOauth];
|
||||
NSString *index_string;
|
||||
NSURL *url;
|
||||
|
||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
||||
NSURL *url = [NSURL fileURLWithPath:path];
|
||||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
||||
[self initOauth];
|
||||
|
||||
[self stringFromFile: @"index.html" url: &url content: &index_string];
|
||||
|
||||
viewDelegate.timelineView = timelineView;
|
||||
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
|
|
Reference in a new issue