mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 13:10:52 +00:00
Fix issues with last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30019 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d205cd7f9e
commit
68ce541e5d
3 changed files with 39 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-03-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/GSGormLoading.m (-awakeWithContext:): Add old NIB loading
|
||||
keys to context. Bug pointed out by Wolfgang Lux <wolfgang.lux@gmail.com>.
|
||||
* Source/GSNibLoading.m: Retain the NSApp and fix other memory issues.
|
||||
|
||||
2010-03-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h,
|
||||
|
|
|
@ -154,6 +154,19 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
|||
NSMutableArray *topObjects;
|
||||
id obj;
|
||||
|
||||
// Add these objects with there old names as the code expects them
|
||||
context = AUTORELEASE([context mutableCopyWithZone: [context zone]]);
|
||||
obj = [context objectForKey: @"NSNibTopLevelObjects"];
|
||||
if (obj != nil)
|
||||
{
|
||||
[(NSMutableDictionary*)context setObject: obj forKey: @"NSTopLevelObjects"];
|
||||
}
|
||||
obj = [context objectForKey: @"NSNibOwner"];
|
||||
if (obj != nil)
|
||||
{
|
||||
[(NSMutableDictionary*)context setObject: obj forKey: @"NSOwner"];
|
||||
}
|
||||
|
||||
isAwake = YES;
|
||||
/*
|
||||
* Add local entries into name table.
|
||||
|
|
|
@ -745,12 +745,12 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
}
|
||||
else
|
||||
{
|
||||
_realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithCoder: coder];
|
||||
ASSIGN(_realObject, [[aClass allocWithZone: NSDefaultMallocZone()] initWithCoder: coder]);
|
||||
[[self superview] replaceSubview: self with: _realObject]; // replace the old view...
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Should release self
|
||||
|
||||
AUTORELEASE(self);
|
||||
return _realObject;
|
||||
}
|
||||
else
|
||||
|
@ -974,7 +974,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
if (GSObjCIsKindOf(aClass, [NSApplication class]) ||
|
||||
[_className isEqual: @"NSApplication"])
|
||||
{
|
||||
_object = [aClass sharedApplication];
|
||||
_object = RETAIN([aClass sharedApplication]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1225,7 +1225,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
||||
ASSIGN(_resourceName, [coder decodeObjectForKey: @"NSResourceName"]);
|
||||
|
||||
// this is a hack, but for now it should do.
|
||||
// FIXME: this is a hack, but for now it should do.
|
||||
if ([_className isEqual: @"NSSound"])
|
||||
{
|
||||
realObject = RETAIN([NSSound soundNamed: _resourceName]);
|
||||
|
@ -2111,7 +2111,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
NSStringFromClass([coder class])];
|
||||
}
|
||||
|
||||
RELEASE(self);
|
||||
AUTORELEASE(self);
|
||||
return RETAIN([NSImage imageNamed: imageName]);
|
||||
}
|
||||
|
||||
|
@ -2162,11 +2162,18 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
if ((self = [super init]) != nil)
|
||||
{
|
||||
_file = nil;
|
||||
_marker = @"NSToolTipHelpKey";
|
||||
ASSIGN(_marker, @"NSToolTipHelpKey");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_file);
|
||||
RELEASE(_marker);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ((self = [super initWithCoder: coder]) != nil)
|
||||
|
@ -2175,17 +2182,17 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
{
|
||||
if ([coder containsValueForKey: @"NSFile"])
|
||||
{
|
||||
_file = RETAIN([coder decodeObjectForKey: @"NSFile"]);
|
||||
ASSIGN(_file, [coder decodeObjectForKey: @"NSFile"]);
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSMarker"])
|
||||
{
|
||||
_marker = RETAIN([coder decodeObjectForKey: @"NSMarker"]);
|
||||
ASSIGN(_marker, [coder decodeObjectForKey: @"NSMarker"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_file = RETAIN([coder decodeObject]);
|
||||
_marker = RETAIN([coder decodeObject]);
|
||||
ASSIGN(_file, [coder decodeObject]);
|
||||
ASSIGN(_marker, [coder decodeObject]);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
@ -2276,7 +2283,8 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
exponent: exponent
|
||||
isNegative: negative];
|
||||
}
|
||||
// FIXME: Needs to release self
|
||||
|
||||
RELEASE(self);
|
||||
return dn;
|
||||
}
|
||||
|
||||
|
@ -2314,5 +2322,3 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue