fix: clearer debug profile (i.e. no "optional")
This commit is contained in:
1 parent
2023ea62cb
commit
e2b94f79e8
2 files changed
+8
-5
No files matched your search
@@ -46,10 +46,17 @@ class DebugProfile {
|
||||
private static func appPreferences() -> String {
|
||||
return nestedSeparator + Preferences.all
|
||||
.sorted { $0.0 < $1.0 }
|
||||
.map { $0.key + intraSeparator + Preferences.getAsString($0.key) }
|
||||
.map { $0.key + intraSeparator + appPreference($0.key) }
|
||||
.joined(separator: nestedSeparator)
|
||||
}
|
||||
|
||||
private static func appPreference(_ key: String) -> String {
|
||||
if let preference = defaults.object(forKey: key) {
|
||||
return String(describing: preference)
|
||||
}
|
||||
return "nil"
|
||||
}
|
||||
|
||||
private static func appWindows() -> String {
|
||||
return nestedSeparator + Windows.list
|
||||
.sorted { $0.cgWindowId < $1.cgWindowId }
|
||||
|
||||
@@ -83,10 +83,6 @@ class Preferences {
|
||||
defaults.string(forKey: key)
|
||||
}
|
||||
|
||||
static func getAsString(_ key: String) -> String {
|
||||
String(describing: defaults.object(forKey: key))
|
||||
}
|
||||
|
||||
static func set(_ key: String, _ value: Any?) {
|
||||
defaults.set(value, forKey: key)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user