Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7c5135f95c
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (43 sloc) 1.202 kb
//
// ProjectController.m
// iGitHub
//
#import "ProjectController.h"
#import "ObjGit.h"
@interface ProjectController ()
@property (nonatomic, copy, readwrite) NSMutableArray *list;
@end
@implementation ProjectController
@synthesize list;
// Custom set accessor to ensure the new list is mutable
- (void)readProjects:(NSString *)projectPath
{
//NSLog(@"READ PROJECTS:%@", projectPath);
BOOL isDir=NO;
[list release];
list = [[NSMutableArray alloc] init];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:projectPath isDirectory:&isDir] && isDir) {
NSEnumerator *e = [[fileManager directoryContentsAtPath:projectPath] objectEnumerator];
NSString *thisDir;
while ( (thisDir = [e nextObject]) ) {
NSString *dir = [projectPath stringByAppendingPathComponent:thisDir];
ObjGit* git = [[ObjGit alloc] init];
[git openRepo:dir];
[git setGitName:thisDir];
[list addObject:git];
}
}
}
// Accessor methods for list
- (unsigned)countOfList {
return [list count];
}
- (id)objectInListAtIndex:(unsigned)theIndex {
return [list objectAtIndex:theIndex];
}
- (void)dealloc {
[list release];
[super dealloc];
}
@end
Jump to Line
Something went wrong with that request. Please try again.