Change name of property setter: isChecking → checking

This commit is contained in:
Allan Odgaard
2017-10-02 20:09:43 +02:00
parent 8d56ad455a
commit e804a57e04
4 changed files with 9 additions and 9 deletions

View File

@@ -2,5 +2,5 @@
@interface SoftwareUpdatePreferences : PreferencesPane
@property (nonatomic, readonly) NSString* lastCheck;
@property (nonatomic, readonly) BOOL isChecking;
@property (nonatomic, readonly, getter = isChecking) BOOL checking;
@end

View File

@@ -9,7 +9,7 @@
// kUserDefaultsLastSoftwareUpdateCheckKey
@interface SoftwareUpdatePreferences ()
@property (nonatomic) BOOL isChecking;
@property (nonatomic, readwrite, getter = isChecking) BOOL checking;
@property (nonatomic) NSDate* lastPoll;
@property (nonatomic) NSString* errorString;
@@ -18,14 +18,14 @@
@end
@implementation SoftwareUpdatePreferences
+ (NSSet*)keyPathsForValuesAffectingLastCheck { return [NSSet setWithObjects:@"isChecking", @"lastPollString", @"errorString", nil]; }
+ (NSSet*)keyPathsForValuesAffectingLastCheck { return [NSSet setWithObjects:@"checking", @"lastPollString", @"errorString", nil]; }
- (id)init
{
if(self = [super initWithNibName:@"SoftwareUpdatePreferences" label:@"Software Update" image:[NSImage imageNamed:@"Software Update" inSameBundleAsClass:[self class]]])
{
[OakStringListTransformer createTransformerWithName:@"OakSoftwareUpdateChannelTransformer" andObjectsArray:@[ kSoftwareUpdateChannelRelease, kSoftwareUpdateChannelBeta ]];
[self bind:@"isChecking" toObject:[SoftwareUpdate sharedInstance] withKeyPath:@"isChecking" options:nil];
[self bind:@"checking" toObject:[SoftwareUpdate sharedInstance] withKeyPath:@"checking" options:nil];
[self bind:@"lastPoll" toObject:[SoftwareUpdate sharedInstance] withKeyPath:@"lastPoll" options:nil];
[self bind:@"errorString" toObject:[SoftwareUpdate sharedInstance] withKeyPath:@"errorString" options:nil];
@@ -43,7 +43,7 @@
- (NSString*)lastCheck
{
return _isChecking ? @"Checking…" : (_errorString ?: (_lastPollString ?: @"Never"));
return _checking ? @"Checking…" : (_errorString ?: (_lastPollString ?: @"Never"));
}
- (void)updateLastPollString:(id)sender

View File

@@ -13,7 +13,7 @@ PUBLIC extern NSString* const kSoftwareUpdateChannelNightly;
PUBLIC @interface SoftwareUpdate : NSObject <DownloadWindowControllerDelegate>
@property (nonatomic) NSDictionary* channels;
@property (nonatomic, readonly) NSDate* lastPoll;
@property (nonatomic, readonly) BOOL isChecking;
@property (nonatomic, readonly, getter = isChecking) BOOL checking;
@property (nonatomic, readonly) NSString* errorString;
- (void)setSignee:(key_chain_t::key_t const&)aSignee;

View File

@@ -43,7 +43,7 @@ typedef std::shared_ptr<shared_state_t> shared_state_ptr;
CGFloat secondsLeft;
}
@property (nonatomic) NSDate* lastPoll;
@property (nonatomic) BOOL isChecking;
@property (nonatomic, readwrite, getter = isChecking) BOOL checking;
@property (nonatomic) NSString* lastVersionDownloaded;
@property (nonatomic) NSString* errorString;
@property (nonatomic) NSTimer* pollTimer;
@@ -134,7 +134,7 @@ typedef std::shared_ptr<shared_state_t> shared_state_ptr;
{
if(self.isChecking)
return;
self.isChecking = YES;
self.checking = YES;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
std::string error = NULL_STR;
@@ -143,7 +143,7 @@ typedef std::shared_ptr<shared_state_t> shared_state_ptr;
dispatch_async(dispatch_get_main_queue(), ^{
self.errorString = [NSString stringWithCxxString:error];
self.lastPoll = [NSDate date];
self.isChecking = NO;
self.checking = NO;
if(self.errorString)
{