Refactoring Part 3: Feed configuration and CoreData Model

This commit is contained in:
relikd
2018-12-09 01:49:26 +01:00
parent ae4700faca
commit 4c1ec7c474
28 changed files with 751 additions and 520 deletions

View File

@@ -25,8 +25,8 @@
#import "BarMenu.h"
#import "UserPrefs.h"
#import "StoreCoordinator.h"
#import <ServiceManagement/ServiceManagement.h>
#import <ServiceManagement/ServiceManagement.h>
@interface SettingsGeneral()
@property (weak) IBOutlet NSPopUpButton *popupHttpApplication;
@@ -48,6 +48,7 @@
#pragma mark - UI interaction with IBAction
/// Run helper application to add thyself to startup items.
- (IBAction)changeStartOnLogin:(NSButton *)sender {
// launchctl list | grep de.relikd
CFStringRef helperIdentifier = CFBridgingRetain(@"de.relikd.baRSS-Helper");

View File

@@ -24,6 +24,7 @@
@implementation UserPrefs
/// @return @c YES if key is not set. Otherwise, return user defaults property from plist.
+ (BOOL)defaultYES:(NSString*)key {
if ([[NSUserDefaults standardUserDefaults] objectForKey:key] == NULL) {
return YES;
@@ -31,14 +32,17 @@
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
}
/// @return @c NO if key is not set. Otherwise, return user defaults property from plist.
+ (BOOL)defaultNO:(NSString*)key {
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
}
/// @return User configured custom browser. Or @c nil if not set yet. (which will fallback to default browser)
+ (NSString*)getHttpApplication {
return [[NSUserDefaults standardUserDefaults] stringForKey:@"defaultHttpApplication"];
}
/// Store custom browser bundle id to user defaults.
+ (void)setHttpApplication:(NSString*)bundleID {
[[NSUserDefaults standardUserDefaults] setObject:bundleID forKey:@"defaultHttpApplication"];
}