mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-30 06:50:52 +00:00
Add proper encoding decoding for keyed objects
This commit is contained in:
parent
15a65bce26
commit
21e8018d7d
1 changed files with 61 additions and 34 deletions
|
@ -384,6 +384,8 @@
|
||||||
self = [super initWithCoder: coder];
|
self = [super initWithCoder: coder];
|
||||||
|
|
||||||
if (self != nil)
|
if (self != nil)
|
||||||
|
{
|
||||||
|
if ([coder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
// These names do not stick to convention. Usually it would be
|
// These names do not stick to convention. Usually it would be
|
||||||
// NS* or NSTreeController* so they must be overriden in
|
// NS* or NSTreeController* so they must be overriden in
|
||||||
|
@ -422,6 +424,10 @@
|
||||||
[coder decodeBoolForKey: @"NSSelectsInsertedObjects"]];
|
[coder decodeBoolForKey: @"NSSelectsInsertedObjects"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -429,6 +435,27 @@
|
||||||
- (void) encodeWithCoder: (NSCoder*)coder
|
- (void) encodeWithCoder: (NSCoder*)coder
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: coder];
|
[super encodeWithCoder: coder];
|
||||||
|
|
||||||
|
if ([coder allowsKeyedCoding])
|
||||||
|
{
|
||||||
|
[coder encodeObject: _childrenKeyPath
|
||||||
|
forKey: @"NSTreeContentChildrenKey"];
|
||||||
|
[coder encodeObject: _countKeyPath
|
||||||
|
forKey: @"NSTreeContentCountKey"];
|
||||||
|
[coder encodeObject: _leafKeyPath
|
||||||
|
forKey: @"NSTreeContentLeafKey"];
|
||||||
|
|
||||||
|
|
||||||
|
[coder encodeBool: _avoidsEmptySelection
|
||||||
|
forKey: @"NSAvoidsEmptySelection"];
|
||||||
|
[coder encodeBool: _preservesSelection
|
||||||
|
forKey: @"NSPreservesSelection"];
|
||||||
|
[coder encodeBool: _selectsInsertedObjects
|
||||||
|
forKey: @"NSSelectsInsertedObjects"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone*)zone
|
- (id) copyWithZone: (NSZone*)zone
|
||||||
|
|
Loading…
Reference in a new issue