submodules are now nested

This commit is contained in:
Tomasz Krasnyk
2010-11-28 00:38:52 +01:00
parent 40e3d8eb2d
commit f12187338e
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -21,7 +21,10 @@ typedef enum {
NSString *checkedOutCommit;
PBGitSubmoduleState submoduleState;
NSMutableArray *submodules;
}
@property (nonatomic, retain, readonly) NSMutableArray *submodules;
@property (nonatomic, assign, readonly) PBGitSubmoduleState submoduleState;
@property (nonatomic, retain, readonly) NSString *name;
@property (nonatomic, retain, readonly) NSString *path;
@@ -31,4 +34,6 @@ typedef enum {
+ (NSImage *) imageForSubmoduleState:(PBGitSubmoduleState) state;
+ (PBGitSubmoduleState) submoduleStateFromCharacter:(unichar) character;
- (void) addSubmodule:(PBGitSubmodule *) submodule;
@end
+13
View File
@@ -20,6 +20,14 @@
@synthesize path;
@synthesize checkedOutCommit;
@synthesize submoduleState;
@synthesize submodules;
- (NSMutableArray *) submodules {
if (!submodules) {
submodules = [[NSMutableArray alloc] init];
}
return submodules;
}
- (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString {
NSParameterAssert([submoduleStatusString length] > 0);
@@ -51,12 +59,17 @@
}
- (void) dealloc {
[submodules release];
[name release];
[path release];
[checkedOutCommit release];
[super dealloc];
}
- (void) addSubmodule:(PBGitSubmodule *) submodule {
[self.submodules addObject:submodule];
}
#pragma mark -
#pragma mark Presentable