Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[api] clean up the ugly casting here
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Nov 9, 2016
1 parent 5644860 commit b2eba0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/HBTSPlusProviderController.x
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@ static NSString *const kHBTSPlusProvidersURL = @"file:///Library/TypeStatus/Prov
}

- (BOOL)providerIsEnabled:(HBTSPlusProvider *)provider {
if (!((HBTSPlusPreferences *)[%c(HBTSPlusPreferences) sharedInstance]).enabled) {
HBTSPlusPreferences *preferences = [%c(HBTSPlusPreferences) sharedInstance];

if (!preferences.enabled) {
return NO;
}

if (provider.preferencesBundle && provider.preferencesClass) {
// the provider manages its own preferences. return YES
return YES;
} else {
return [(HBTSPlusPreferences *)[%c(HBTSPlusPreferences) sharedInstance] providerIsEnabled:provider.appIdentifier];
return [preferences providerIsEnabled:provider.appIdentifier];
}
}

Expand Down

0 comments on commit b2eba0f

Please sign in to comment.