From fe438e779e81d948b4699a4d797770c74ab047ee Mon Sep 17 00:00:00 2001 From: wlux Date: Sun, 30 May 2010 22:55:39 +0000 Subject: [PATCH] Avoid loading a window controller's nib prematurely if the document edited status is changed. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30500 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSWindowController.m | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e1d37d0f..baf5b5988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-05-31 Wolfgang Lux + + * Source/NSWindowController.m (-setDocumentEdited:, -setWindow:): + Avoid loading the controller's nib prematurely if the document + edited status is changed. + 2010-05-30 Wolfgang Lux * Source/NSFont.m (-initWithCoder:): Fixed keyed decoding to fall diff --git a/Source/NSWindowController.m b/Source/NSWindowController.m index 6dee5e5fa..396e0e207 100644 --- a/Source/NSWindowController.m +++ b/Source/NSWindowController.m @@ -208,7 +208,8 @@ - (void) setDocumentEdited: (BOOL)flag { - [[self window] setDocumentEdited: flag]; + if ([self isWindowLoaded]) + [[self window] setDocumentEdited: flag]; } - (void) setWindowFrameAutosaveName:(NSString *)name @@ -368,6 +369,7 @@ else { [_window setReleasedWhenClosed: YES]; + [_window setDocumentEdited: [_document isDocumentEdited]]; } } @@ -402,7 +404,7 @@ NSString *title = [self windowTitleForDocumentDisplayName: displayName]; /* If they just want to display the filename, use the fancy method */ - /* NB For compatibility with Mac OS X, a document display name is equal + /* NB For compatibility with Mac OS X, a document's display name is equal to its last path component, so we check for that here too */ if (filename != nil && ([title isEqualToString: filename] ||