projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Formal protocol for the interface shared between Joysticks and JSActions, use new...
[enjoyable.git]
/
Config.m
diff --git
a/Config.m
b/Config.m
index
a02c4ce
..
046ccc2
100644
(file)
--- a/
Config.m
+++ b/
Config.m
@@
-13,7
+13,7
@@
- (id)initWithName:(NSString *)name {
if ((self = [super init])) {
- (id)initWithName:(NSString *)name {
if ((self = [super init])) {
- self.name = name;
+ self.name = name
? name : @"Untitled"
;
_entries = [[NSMutableDictionary alloc] init];
}
return self;
_entries = [[NSMutableDictionary alloc] init];
}
return self;
@@
-34,8
+34,11
@@
- (NSDictionary *)serialize {
NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
- (NSDictionary *)serialize {
NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
- for (id key in _entries)
- cfgEntries[key] = [_entries[key] serialize];
+ for (id key in _entries) {
+ id serialized = [_entries[key] serialize];
+ if (serialized)
+ cfgEntries[key] = serialized;
+ }
return @{ @"name": _name, @"entries": cfgEntries };
}
return @{ @"name": _name, @"entries": cfgEntries };
}