Skip to content

Commit

Permalink
Move UserDefaults extension back to PreferencesWindowController
Browse files Browse the repository at this point in the history
Fixes a build error in the UI tests.
  • Loading branch information
zorgiepoo committed Oct 14, 2023
1 parent 5c314e1 commit 349a0a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions Komet/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ enum FontType {
case comments
}

// This extension is for creating a KeyPath for Preferences to observe if the window style changes
extension UserDefaults
{
@objc dynamic var ZGWindowStyleTheme: Any?
{
get {
return object(forKey: ZGWindowStyleThemeKey)
}
set {
set(newValue, forKey: ZGWindowStyleThemeKey)
}
}
}

@objc class ZGPreferencesWindowController: NSWindowController {
private weak var editorListener: UserDefaultsEditorListener?
private weak var updaterListener: UpdaterSettingsListener?
Expand Down
14 changes: 0 additions & 14 deletions Komet/UserDefaultKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,3 @@ let ZGEnableBetaUpdatesKey = "ZGEnableBetaUpdates"
// Environment options for test automation
let ZGBreadcrumbsURLKey = "ZGBreadcrumbsURL"
let ZGProjectNameKey = "ZGProjectName"

// This extension is for creating a KeyPath for Preferences to observe if the window style changes
extension UserDefaults
{
@objc dynamic var ZGWindowStyleTheme: Any?
{
get {
return object(forKey: ZGWindowStyleThemeKey)
}
set {
set(newValue, forKey: ZGWindowStyleThemeKey)
}
}
}

0 comments on commit 349a0a1

Please sign in to comment.