mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Changes to facilitate XIB loading in IB/Gorm. Added customClassNames to IBObjectContainer and skipped instantiation of custom classes in GSXib5KeyedUnarchiver if we are currently loading as a model in IB/Gorm.
This commit is contained in:
parent
b97aca9cd4
commit
79fa1b68cd
4 changed files with 29 additions and 4 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2021-04-25 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSXibLoading.h: Add declaration
|
||||
for customClassNames so that we can use that to collect the names
|
||||
of all of the custom classes and their associations.
|
||||
* Source/GNUmakefile: Remove classes which are not used.
|
||||
* Source/GSXib5KeyedUnarchiver.m: In parserDidStartElement...
|
||||
call isInInterfaceBuilder to determine if we should allocate
|
||||
custom classes.
|
||||
* Source/GSXibLoading.m: Add in code in nibInstantiate which uses
|
||||
[NSClassSwapper isInInterfaceBuilder] to prevent connections
|
||||
from being established if the XIB is being loaded in IB/Gorm.
|
||||
|
||||
2021-04-23 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/Functions.m: QuickFix. Remove unecessary warning
|
||||
|
|
|
@ -159,6 +159,7 @@
|
|||
- (id) nibInstantiate;
|
||||
- (NSEnumerator *) connectionRecordEnumerator;
|
||||
- (NSEnumerator *) objectRecordEnumerator;
|
||||
- (NSDictionary *) customClassNames;
|
||||
@end
|
||||
|
||||
@interface IBUserDefinedRuntimeAttributesPlaceholder : NSObject <NSCoding>
|
||||
|
|
|
@ -760,11 +760,16 @@ didStartElement: (NSString*)elementName
|
|||
NSString *className = nil;
|
||||
NSString *elementType = elementName;
|
||||
|
||||
if (([@"window" isEqualToString: elementName] == NO) &&
|
||||
([@"customView" isEqualToString: elementName] == NO) &&
|
||||
([@"customObject" isEqualToString: elementName] == NO))
|
||||
// If we are in IB we don't want to handle custom classes since they are
|
||||
// not linked into the application.
|
||||
if ([NSClassSwapper isInInterfaceBuilder] == NO)
|
||||
{
|
||||
className = [attributes objectForKey: @"customClass"];
|
||||
if (([@"window" isEqualToString: elementName] == NO) &&
|
||||
([@"customView" isEqualToString: elementName] == NO) &&
|
||||
([@"customObject" isEqualToString: elementName] == NO))
|
||||
{
|
||||
className = [attributes objectForKey: @"customClass"];
|
||||
}
|
||||
}
|
||||
|
||||
if (nil == className)
|
||||
|
|
|
@ -1039,6 +1039,12 @@
|
|||
NSEnumerator *en;
|
||||
id obj;
|
||||
|
||||
// If we are currently in IB, then don't do anything.
|
||||
if ([NSClassSwapper isInInterfaceBuilder])
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
// iterate over connections, instantiate, and then establish them.
|
||||
en = [connectionRecords objectEnumerator];
|
||||
while ((obj = [en nextObject]) != nil)
|
||||
|
|
Loading…
Reference in a new issue