Removed obsolete AppDefaults values
This commit is contained in:
parent
2292d04f91
commit
782ae1c5cd
|
@ -26,13 +26,6 @@ enum UserInterfaceColorPalette: Int, CustomStringConvertible, CaseIterable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum FontSize: Int {
|
|
||||||
case small = 0
|
|
||||||
case medium = 1
|
|
||||||
case large = 2
|
|
||||||
case veryLarge = 3
|
|
||||||
}
|
|
||||||
|
|
||||||
final class AppDefaults: ObservableObject {
|
final class AppDefaults: ObservableObject {
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
@ -64,24 +57,19 @@ final class AppDefaults: ObservableObject {
|
||||||
static let addFolderAccountID = "addFolderAccountID"
|
static let addFolderAccountID = "addFolderAccountID"
|
||||||
static let timelineSortDirection = "timelineSortDirection"
|
static let timelineSortDirection = "timelineSortDirection"
|
||||||
|
|
||||||
// iOS Defaults
|
|
||||||
static let userInterfaceColorPalette = "userInterfaceColorPalette"
|
static let userInterfaceColorPalette = "userInterfaceColorPalette"
|
||||||
static let timelineGroupByFeed = "timelineGroupByFeed"
|
static let timelineGroupByFeed = "timelineGroupByFeed"
|
||||||
static let refreshClearsReadArticles = "refreshClearsReadArticles"
|
|
||||||
static let timelineNumberOfLines = "timelineNumberOfLines"
|
|
||||||
static let timelineIconSize = "timelineIconSize"
|
static let timelineIconSize = "timelineIconSize"
|
||||||
|
static let timelineNumberOfLines = "timelineNumberOfLines"
|
||||||
|
|
||||||
|
// iOS Defaults
|
||||||
|
static let refreshClearsReadArticles = "refreshClearsReadArticles"
|
||||||
static let articleFullscreenAvailable = "articleFullscreenAvailable"
|
static let articleFullscreenAvailable = "articleFullscreenAvailable"
|
||||||
static let articleFullscreenEnabled = "articleFullscreenEnabled"
|
static let articleFullscreenEnabled = "articleFullscreenEnabled"
|
||||||
static let confirmMarkAllAsRead = "confirmMarkAllAsRead"
|
static let confirmMarkAllAsRead = "confirmMarkAllAsRead"
|
||||||
|
|
||||||
// macOS Defaults
|
// macOS Defaults
|
||||||
static let windowState = "windowState"
|
|
||||||
static let sidebarFontSize = "sidebarFontSize"
|
|
||||||
static let timelineFontSize = "timelineFontSize"
|
|
||||||
static let detailFontSize = "detailFontSize"
|
|
||||||
static let openInBrowserInBackground = "openInBrowserInBackground"
|
static let openInBrowserInBackground = "openInBrowserInBackground"
|
||||||
static let importOPMLAccountID = "importOPMLAccountID"
|
|
||||||
static let exportOPMLAccountID = "exportOPMLAccountID"
|
|
||||||
static let defaultBrowserID = "defaultBrowserID"
|
static let defaultBrowserID = "defaultBrowserID"
|
||||||
static let checkForUpdatesAutomatically = "checkForUpdatesAutomatically"
|
static let checkForUpdatesAutomatically = "checkForUpdatesAutomatically"
|
||||||
static let downloadTestBuilds = "downloadTestBuild"
|
static let downloadTestBuilds = "downloadTestBuild"
|
||||||
|
@ -99,9 +87,6 @@ final class AppDefaults: ObservableObject {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static let smallestFontSizeRawValue = FontSize.small.rawValue
|
|
||||||
private static let largestFontSizeRawValue = FontSize.veryLarge.rawValue
|
|
||||||
|
|
||||||
// MARK: Development Builds
|
// MARK: Development Builds
|
||||||
let isDeveloperBuild: Bool = {
|
let isDeveloperBuild: Bool = {
|
||||||
if let dev = Bundle.main.object(forInfoDictionaryKey: "DeveloperEntitlements") as? String, dev == "-dev" {
|
if let dev = Bundle.main.object(forInfoDictionaryKey: "DeveloperEntitlements") as? String, dev == "-dev" {
|
||||||
|
@ -220,64 +205,12 @@ final class AppDefaults: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Window State
|
// MARK: Window State
|
||||||
var windowState: [AnyHashable : Any]? {
|
|
||||||
get {
|
|
||||||
return AppDefaults.store.object(forKey: Key.windowState) as? [AnyHashable : Any]
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
UserDefaults.standard.set(newValue, forKey: Key.windowState)
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AppStorage(wrappedValue: false, Key.openInBrowserInBackground, store: store) var openInBrowserInBackground: Bool {
|
@AppStorage(wrappedValue: false, Key.openInBrowserInBackground, store: store) var openInBrowserInBackground: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
objectWillChange.send()
|
objectWillChange.send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var sidebarFontSize: FontSize {
|
|
||||||
get {
|
|
||||||
return fontSize(for: Key.sidebarFontSize)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
AppDefaults.store.set(newValue.rawValue, forKey: Key.sidebarFontSize)
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var timelineFontSize: FontSize {
|
|
||||||
get {
|
|
||||||
return fontSize(for: Key.timelineFontSize)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
AppDefaults.store.set(newValue.rawValue, forKey: Key.timelineFontSize)
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var detailFontSize: FontSize {
|
|
||||||
get {
|
|
||||||
return fontSize(for: Key.detailFontSize)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
AppDefaults.store.set(newValue.rawValue, forKey: Key.detailFontSize)
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AppStorage(Key.importOPMLAccountID, store: store) var importOPMLAccountID: String? {
|
|
||||||
didSet {
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AppStorage(Key.exportOPMLAccountID, store: store) var exportOPMLAccountID: String? {
|
|
||||||
didSet {
|
|
||||||
objectWillChange.send()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AppStorage(Key.defaultBrowserID, store: store) var defaultBrowserID: String? {
|
@AppStorage(Key.defaultBrowserID, store: store) var defaultBrowserID: String? {
|
||||||
didSet {
|
didSet {
|
||||||
objectWillChange.send()
|
objectWillChange.send()
|
||||||
|
@ -346,8 +279,4 @@ extension AppDefaults {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func fontSize(for key: String) -> FontSize {
|
|
||||||
// Punted till after 1.0.
|
|
||||||
return .medium
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue