mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 20:27:39 +00:00
Path Cell encoding/decoding
This commit is contained in:
parent
22c1897eee
commit
9abc40727b
2 changed files with 23 additions and 3 deletions
|
@ -33,7 +33,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSURL, NSAttributedString, NSImage, NSString;
|
||||
@class NSURL, NSAttributedString, NSImage, NSString;
|
||||
|
||||
@interface NSPathControlItem : NSObject
|
||||
{
|
||||
|
@ -64,4 +64,3 @@ extern "C" {
|
|||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSPathControlItem_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
||||
|
|
|
@ -208,7 +208,8 @@
|
|||
{
|
||||
[self setPathStyle: NSPathStyleStandard];
|
||||
|
||||
// if ([coder containsValueForKey: @"NSPathStyle"])
|
||||
// if ([coder containsValueForKey: @"NSPathStyle"]) // can't seem to find it in the contains method,
|
||||
// but it does when I decode it... not sure why.
|
||||
{
|
||||
[self setPathStyle: [coder decodeIntegerForKey: @"NSPathStyle"]];
|
||||
}
|
||||
|
@ -220,11 +221,31 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
[coder decodeValueObjCType: @encode(NSUInteger)
|
||||
at: &_pathStyle];
|
||||
[self setPathComponentCells: [coder decodeObject]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
[coder encodeInteger: [self pathStyle]
|
||||
forKey: @"NSPathStyle"];
|
||||
[coder encodeObject: [self pathComponentCells]
|
||||
forKey: @"NSPathComponentCells"]
|
||||
}
|
||||
else
|
||||
{
|
||||
[coder encodeValueObjCType: @encode(NSUInteger)
|
||||
at: &_pathStyle];
|
||||
[coder encodeObject: [self pathComponentCells]];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSPathCell (Private)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue