remove unnecessary setMod() calls
This commit is contained in:
parent
57d7e3e2ab
commit
605ad1c9ee
@ -214,7 +214,7 @@ class Collection:
|
||||
ls = property(_get_ls, _set_ls)
|
||||
|
||||
# legacy
|
||||
def setMod(self, mod: Optional[int] = None) -> None:
|
||||
def setMod(self) -> None:
|
||||
# this is now a no-op, as modifications to things like the config
|
||||
# will mark the collection modified automatically
|
||||
pass
|
||||
@ -322,7 +322,6 @@ class Collection:
|
||||
if check and not hooks.schema_will_change(proceed=True):
|
||||
raise AnkiError("abortSchemaMod")
|
||||
self.scm = intTime(1000)
|
||||
self.setMod()
|
||||
self.save()
|
||||
|
||||
def schemaChanged(self) -> Any:
|
||||
@ -655,11 +654,9 @@ class Collection:
|
||||
return default
|
||||
|
||||
def set_config(self, key: str, val: Any) -> None:
|
||||
self.setMod()
|
||||
self.conf.set(key, val)
|
||||
|
||||
def remove_config(self, key: str) -> None:
|
||||
self.setMod()
|
||||
self.conf.remove(key)
|
||||
|
||||
def all_config(self) -> Dict[str, Any]:
|
||||
@ -670,14 +667,12 @@ class Collection:
|
||||
return self._backend.get_config_bool(key)
|
||||
|
||||
def set_config_bool(self, key: Config.Bool.Key.V, value: bool) -> None:
|
||||
self.setMod()
|
||||
self._backend.set_config_bool(key=key, value=value)
|
||||
|
||||
def get_config_string(self, key: Config.String.Key.V) -> str:
|
||||
return self._backend.get_config_string(key)
|
||||
|
||||
def set_config_string(self, key: Config.String.Key.V, value: str) -> None:
|
||||
self.setMod()
|
||||
self._backend.set_config_string(key=key, value=value)
|
||||
|
||||
# Stats
|
||||
|
@ -296,7 +296,6 @@ class AnkiExporter(Exporter):
|
||||
self.dst.crt = self.src.crt
|
||||
# todo: tags?
|
||||
self.count = self.dst.cardCount()
|
||||
self.dst.setMod()
|
||||
self.postExport()
|
||||
self.dst.close(downgrade=True)
|
||||
|
||||
|
@ -166,7 +166,6 @@ class ModelManager:
|
||||
|
||||
def setCurrent(self, m: NoteType) -> None:
|
||||
self.col.conf["curModel"] = m["id"]
|
||||
self.col.setMod()
|
||||
|
||||
# Retrieving and creating models
|
||||
#############################################################
|
||||
|
@ -855,13 +855,11 @@ QTableView {{ gridline-color: {grid} }}
|
||||
if type == "noteFld":
|
||||
ord = not ord
|
||||
self.col.set_config_bool(Config.Bool.BROWSER_SORT_BACKWARDS, ord)
|
||||
self.col.setMod()
|
||||
self.col.save()
|
||||
self.search()
|
||||
else:
|
||||
if self.col.get_config_bool(Config.Bool.BROWSER_SORT_BACKWARDS) != ord:
|
||||
self.col.set_config_bool(Config.Bool.BROWSER_SORT_BACKWARDS, ord)
|
||||
self.col.setMod()
|
||||
self.col.save()
|
||||
self.model.reverse()
|
||||
self.setSortIndicator()
|
||||
|
@ -165,8 +165,6 @@ class Preferences(QDialog):
|
||||
|
||||
self.mw.col.set_preferences(self.prefs)
|
||||
|
||||
d.setMod()
|
||||
|
||||
# Network
|
||||
######################################################################
|
||||
|
||||
@ -209,7 +207,6 @@ class Preferences(QDialog):
|
||||
)
|
||||
if self.form.fullSync.isChecked():
|
||||
self.mw.col.modSchema(check=False)
|
||||
self.mw.col.setMod()
|
||||
|
||||
# Backup
|
||||
######################################################################
|
||||
|
@ -222,7 +222,6 @@ class Previewer(QDialog):
|
||||
def _on_show_both_sides(self, toggle: bool) -> None:
|
||||
self._show_both_sides = toggle
|
||||
self.mw.col.set_config_bool(Config.Bool.PREVIEW_BOTH_SIDES, toggle)
|
||||
self.mw.col.setMod()
|
||||
if self._state == "answer" and not toggle:
|
||||
self._state = "question"
|
||||
self.render_card()
|
||||
|
Loading…
Reference in New Issue
Block a user