mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
added equality for autotype context
This commit is contained in:
@@ -65,4 +65,6 @@
|
||||
- (instancetype)initWithDefaultSequenceForEntry:(KPKEntry *)entry;
|
||||
- (instancetype)initWithWindowAssociation:(KPKWindowAssociation *)association;
|
||||
|
||||
- (BOOL)isEqualToAutotypeContext:(MPAutotypeContext *)context;
|
||||
|
||||
@end
|
||||
|
||||
@@ -57,6 +57,19 @@
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
return [self isEqualToAutotypeContext:object];
|
||||
}
|
||||
|
||||
- (BOOL)isEqualToAutotypeContext:(MPAutotypeContext *)context {
|
||||
if(![context isKindOfClass:self.class]) {
|
||||
return NO;
|
||||
}
|
||||
if(KPKComparsionDifferent == [self.entry compareToEntry:context.entry]) {
|
||||
return NO;
|
||||
}
|
||||
return [self.normalizedCommand isEqualToString:context.normalizedCommand];
|
||||
}
|
||||
|
||||
- (BOOL)valid {
|
||||
return (self.normalizedCommand != nil);
|
||||
|
||||
Reference in New Issue
Block a user