mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 14:50:38 +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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@class NSURL, NSAttributedString, NSImage, NSString;
|
@class NSURL, NSAttributedString, NSImage, NSString;
|
||||||
|
|
||||||
@interface NSPathControlItem : NSObject
|
@interface NSPathControlItem : NSObject
|
||||||
{
|
{
|
||||||
|
@ -64,4 +64,3 @@ extern "C" {
|
||||||
#endif /* GS_API_MACOSX */
|
#endif /* GS_API_MACOSX */
|
||||||
|
|
||||||
#endif /* _NSPathControlItem_h_GNUSTEP_GUI_INCLUDE */
|
#endif /* _NSPathControlItem_h_GNUSTEP_GUI_INCLUDE */
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,8 @@
|
||||||
{
|
{
|
||||||
[self setPathStyle: NSPathStyleStandard];
|
[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"]];
|
[self setPathStyle: [coder decodeIntegerForKey: @"NSPathStyle"]];
|
||||||
}
|
}
|
||||||
|
@ -220,11 +221,31 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
[coder decodeValueObjCType: @encode(NSUInteger)
|
||||||
|
at: &_pathStyle];
|
||||||
|
[self setPathComponentCells: [coder decodeObject]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
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
|
@end
|
||||||
|
|
||||||
@implementation NSPathCell (Private)
|
@implementation NSPathCell (Private)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue