Skip to content

Commit

Permalink
- ServerSideSearchScope: save last used searchedContent (name, conten…
Browse files Browse the repository at this point in the history
…t - or name+content) and reuse it next time the scope is invoked, default to name+content
  • Loading branch information
felix-schwarz committed Jan 28, 2025
1 parent d831478 commit 85e9201
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ class ServerSideSearchScope: ItemSearchScope {
}

override var searchedContent: OCKQLSearchedContent {
didSet {
get {
let value = OCAppIdentity.shared.userDefaults?.value(forKey: "LastUsedSearchedContent")
if let intVal = value as? Int {
return OCKQLSearchedContent(rawValue: intVal)
}
return [.itemName, .contents]
}
set {
OCAppIdentity.shared.userDefaults?.setValue(newValue.rawValue, forKey: "LastUsedSearchedContent")
updateSearch()
}
}
Expand Down

0 comments on commit 85e9201

Please sign in to comment.