aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTreeNode.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-03-05 00:14:43 +0000
committerstuconnolly <stuart02@gmail.com>2011-03-05 00:14:43 +0000
commit32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c (patch)
tree4d1f2fe472fa622665b81f775f3a43f924a5b71f /Source/SPTreeNode.m
parentbea72ac3bbebb9e35e34b840968b4ba0f433e87a (diff)
downloadsequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.tar.gz
sequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.tar.bz2
sequelpro-32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c.zip
Add support for auto saving expanded items.
Diffstat (limited to 'Source/SPTreeNode.m')
-rw-r--r--Source/SPTreeNode.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/SPTreeNode.m b/Source/SPTreeNode.m
index 7be4f09a..3d5f2ebc 100644
--- a/Source/SPTreeNode.m
+++ b/Source/SPTreeNode.m
@@ -27,6 +27,9 @@
#import "SPFavoriteNode.h"
#import "SPGroupNode.h"
+// Constants
+static const NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup";
+
@implementation SPTreeNode
@synthesize isGroup;
@@ -248,6 +251,21 @@
}
#pragma mark -
+#pragma mark Coding protocol methods
+
+- (id)initWithCoder:(NSCoder *)coder
+{
+ [self setIsGroup:[[coder decodeObjectForKey:SPTreeNodeIsGroupKey] boolValue]];
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeObject:[NSNumber numberWithBool:[self isGroup]] forKey:SPTreeNodeIsGroupKey];
+}
+
+#pragma mark -
#pragma mark Other
- (NSString *)description