mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
GitRevSpecifier: Add NSCoder protocol
This way, the RevSpecs can be loaded from a menu, so we can use them in the toolbar customization
This commit is contained in:
@@ -27,6 +27,13 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithCoder:(NSCoder *)coder
|
||||
{
|
||||
parameters = [coder decodeObjectForKey:@"Parameters"];
|
||||
description = [coder decodeObjectForKey:@"Description"];
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (PBGitRevSpecifier *)allBranchesRevSpec
|
||||
{
|
||||
id revspec = [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--all"]];
|
||||
@@ -87,4 +94,10 @@
|
||||
return ([[parameters componentsJoinedByString:@" "] isEqualToString: [other.parameters componentsJoinedByString:@" "]] &&
|
||||
(!description || [description isEqualToString:other.description]));
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder:(NSCoder *)coder
|
||||
{
|
||||
[coder encodeObject:description forKey:@"Description"];
|
||||
[coder encodeObject:parameters forKey:@"Parameters"];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user