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 <Cocoa/Cocoa.h>
|
||||||
#import <Webkit/Webkit.h>
|
#import <WebKit/WebKit.h>
|
||||||
#import "ViewDelegate.h"
|
#import "ViewDelegate.h"
|
||||||
#import <Carbon/Carbon.h>
|
#import <Carbon/Carbon.h>
|
||||||
#import "Constants.h"
|
#import "Constants.h"
|
||||||
|
@ -81,6 +81,8 @@
|
||||||
- (NSString *)stringForKey:(NSString *)aKey;
|
- (NSString *)stringForKey:(NSString *)aKey;
|
||||||
- (void)loggedIn;
|
- (void)loggedIn;
|
||||||
|
|
||||||
|
- (void)stringFromFile:(NSString *)file url: (NSURL **) url content: (NSString **) content;
|
||||||
|
|
||||||
- (IBAction)login:(id)sender;
|
- (IBAction)login:(id)sender;
|
||||||
- (IBAction)logout:(id)sender;
|
- (IBAction)logout:(id)sender;
|
||||||
|
|
||||||
|
|
|
@ -81,14 +81,20 @@
|
||||||
|
|
||||||
# pragma mark Init
|
# 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
|
- (void)initOauth
|
||||||
{
|
{
|
||||||
if (!oauthView) {
|
if (!oauthView) {
|
||||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
NSString *index_string;
|
||||||
NSURL *url = [NSURL fileURLWithPath:path];
|
NSURL *url;
|
||||||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
|
||||||
|
[self stringFromFile: @"index.html" url: &url content: &index_string];
|
||||||
|
|
||||||
oauthView = [[WebView alloc] init];
|
oauthView = [[WebView alloc] init];
|
||||||
viewDelegate.oauthView = oauthView;
|
viewDelegate.oauthView = oauthView;
|
||||||
|
@ -106,11 +112,12 @@
|
||||||
|
|
||||||
if (viewDelegate.timelineView != timelineView)
|
if (viewDelegate.timelineView != timelineView)
|
||||||
{
|
{
|
||||||
[self initOauth];
|
NSString *index_string;
|
||||||
|
NSURL *url;
|
||||||
|
|
||||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
[self initOauth];
|
||||||
NSURL *url = [NSURL fileURLWithPath:path];
|
|
||||||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
[self stringFromFile: @"index.html" url: &url content: &index_string];
|
||||||
|
|
||||||
viewDelegate.timelineView = timelineView;
|
viewDelegate.timelineView = timelineView;
|
||||||
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
|
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||||
|
|
Reference in a new issue