Simplify code

If the window hadn’t been loaded yet, we previously had to delay opening the document when changing tab (in code).

Since we now create the window in the initializer, there is no longer need for this.
This commit is contained in:
Allan Odgaard
2012-09-16 17:00:42 +02:00
parent 1a1a80629c
commit d4f6cbacf3
3 changed files with 1 additions and 14 deletions

View File

@@ -31,8 +31,6 @@ PUBLIC @interface DocumentController : NSWindowController <NSWindowDelegate, Oak
OakHTMLOutputView* htmlOutputView;
command::runner_ptr runner;
BOOL windowHasLoaded;
BOOL fileBrowserHidden;
NSDictionary* fileBrowserState;

View File

@@ -415,7 +415,6 @@ OAK_DEBUG_VAR(DocumentController);
layoutView.tabBarView = tabBarView;
[self windowDidLoad];
[self windowDidBecomeMain:nil];
}
return self;
}
@@ -544,15 +543,6 @@ OAK_DEBUG_VAR(DocumentController);
self.isDocumentEdited = doc->is_modified();
}
- (void)windowDidBecomeMain:(NSNotification*)aNotification
{
if(!windowHasLoaded)
{
windowHasLoaded = YES;
self.selectedTabIndex = selectedTabIndex;
}
}
- (void)updateProxyIcon
{
struct callback_t : scm::callback_t

View File

@@ -37,8 +37,7 @@ namespace
// This is also set after open succeeds
[self synchronizeWindowTitle];
if(windowHasLoaded)
[[DocumentOpenHelper new] tryOpenDocument:self.selectedDocument forWindow:self.window delegate:self];
[[DocumentOpenHelper new] tryOpenDocument:self.selectedDocument forWindow:self.window delegate:self];
}
- (document::document_ptr const&)selectedDocument