mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
Partially converted to modern Objective-C
Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -106,10 +106,18 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if([self.superclass instancesRespondToSelector:@selector(setControlSize:)]) {
|
||||
super.controlSize = controlSize;
|
||||
}
|
||||
else {
|
||||
self.cell.controlSize = controlSize;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSControlSize)controlSize {
|
||||
if([self.superclass instancesRespondToSelector:@selector(controlSize)]) {
|
||||
return super.controlSize;
|
||||
}
|
||||
return self.cell.controlSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
}
|
||||
|
||||
- (NSControlSize)controlSize {
|
||||
if([self.superclass instancesRespondToSelector:@selector(controlSize)]) {
|
||||
return super.controlSize;
|
||||
}
|
||||
return self.cell.controlSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
if(validateTarget) {
|
||||
isValid &= [validateTarget validateToolbarItem:self];
|
||||
}
|
||||
[self setEnabled:isValid];
|
||||
self.enabled = isValid;
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -14,6 +14,6 @@ FOUNDATION_EXPORT NSString *const MPErrorDomain;
|
||||
|
||||
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description;
|
||||
|
||||
- (NSString *)descriptionForErrorCode;
|
||||
@property (nonatomic, readonly, copy) NSString *descriptionForErrorCode;
|
||||
|
||||
@end
|
||||
|
||||
@@ -13,7 +13,7 @@ NSString *const MPErrorDomain = @"com.hicknhack.macpass.error";
|
||||
@implementation NSError (Messages)
|
||||
|
||||
- (NSString *)descriptionForErrorCode {
|
||||
return [NSString stringWithFormat:@"%@ (%ld)", [self localizedDescription], [self code] ];
|
||||
return [NSString stringWithFormat:@"%@ (%ld)", self.localizedDescription, self.code ];
|
||||
}
|
||||
|
||||
+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description {
|
||||
|
||||
Reference in New Issue
Block a user