From 235f48c5ea140b9547beb38687231f20c825a3bb Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 24 Aug 2007 04:51:53 +0000 Subject: [PATCH] Corrected issue found by Riccardo for version 0 gorm files. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@25414 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ GormCore/GormPrivate.m | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 785357b4..6f52d73f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-24 00:50-EDT Gregory John Casamento + + * GormCore/GormPrivate.m: Changed initWithCoder: to handle + older .gorm (version 0) files correctly. + 2007-08-19 21:22-EDT Gregory John Casamento * ChangeLog diff --git a/GormCore/GormPrivate.m b/GormCore/GormPrivate.m index 18a962df..f6a69f8f 100644 --- a/GormCore/GormPrivate.m +++ b/GormCore/GormPrivate.m @@ -40,6 +40,9 @@ NSString *GormDidDeleteClassNotification = @"GormDidDeleteClassNotification"; NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectFromDocumentNotification"; NSString *GormResizeCellNotification = @"GormResizeCellNotification"; +// Private, and soon to be deprecated, notification string... +NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedNotification"; + // Define this as "NO" initially. We only want to turn this on while loading or testing. static BOOL _isInInterfaceBuilder = NO; @@ -126,7 +129,9 @@ static BOOL _isInInterfaceBuilder = NO; { int version = [aCoder versionForClassName: NSStringFromClass([GSNibItem class])]; - + int cv = [aCoder versionForClassName: + NSStringFromClass([GSNibContainer class])]; + if (version == NSNotFound) { NSLog(@"no GSNibItem"); @@ -134,6 +139,14 @@ static BOOL _isInInterfaceBuilder = NO; NSStringFromClass([GormObjectProxy class])]; } + // add to the top level items during unarchiving, if the container is old. + if (cv == 0) + { + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc postNotificationName: GSInternalNibItemAddedNotification + object: self]; + } + if (version == 0) { // do not decode super (it would try to morph into theClass ! )