mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
Use correct default values for missing keys
This commit is contained in:
parent
e6f970e969
commit
d88be5b856
2 changed files with 6 additions and 4 deletions
|
|
@ -406,7 +406,9 @@ class Browser(QMainWindow):
|
||||||
self.form.searchEdit.lineEdit().setPlaceholderText(
|
self.form.searchEdit.lineEdit().setPlaceholderText(
|
||||||
tr.browsing_search_bar_hint()
|
tr.browsing_search_bar_hint()
|
||||||
)
|
)
|
||||||
self.form.searchEdit.addItems([""] + self.mw.pm.profile.get("searchHistory"))
|
self.form.searchEdit.addItems(
|
||||||
|
[""] + self.mw.pm.profile.get("searchHistory", [])
|
||||||
|
)
|
||||||
if search is not None:
|
if search is not None:
|
||||||
self.search_for_terms(*search)
|
self.search_for_terms(*search)
|
||||||
else:
|
else:
|
||||||
|
|
@ -451,7 +453,7 @@ class Browser(QMainWindow):
|
||||||
showWarning(str(err))
|
showWarning(str(err))
|
||||||
|
|
||||||
def update_history(self) -> None:
|
def update_history(self) -> None:
|
||||||
sh = self.mw.pm.profile.get("searchHistory")
|
sh = self.mw.pm.profile.get("searchHistory", [])
|
||||||
if self._lastSearchTxt in sh:
|
if self._lastSearchTxt in sh:
|
||||||
sh.remove(self._lastSearchTxt)
|
sh.remove(self._lastSearchTxt)
|
||||||
sh.insert(0, self._lastSearchTxt)
|
sh.insert(0, self._lastSearchTxt)
|
||||||
|
|
|
||||||
|
|
@ -632,10 +632,10 @@ create table if not exists profiles
|
||||||
self.profile["hostNum"] = val or 0
|
self.profile["hostNum"] = val or 0
|
||||||
|
|
||||||
def media_syncing_enabled(self) -> bool:
|
def media_syncing_enabled(self) -> bool:
|
||||||
return self.profile.get("syncMedia")
|
return self.profile.get("syncMedia", True)
|
||||||
|
|
||||||
def auto_syncing_enabled(self) -> bool:
|
def auto_syncing_enabled(self) -> bool:
|
||||||
return self.profile.get("autoSync")
|
return self.profile.get("autoSync", True)
|
||||||
|
|
||||||
def sync_auth(self) -> SyncAuth | None:
|
def sync_auth(self) -> SyncAuth | None:
|
||||||
if not (hkey := self.profile.get("syncKey")):
|
if not (hkey := self.profile.get("syncKey")):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue