diff --git a/spinetoolbox/spine_db_editor/mvcmodels/multi_db_tree_model.py b/spinetoolbox/spine_db_editor/mvcmodels/multi_db_tree_model.py index 7a9650524..d2727fa9b 100644 --- a/spinetoolbox/spine_db_editor/mvcmodels/multi_db_tree_model.py +++ b/spinetoolbox/spine_db_editor/mvcmodels/multi_db_tree_model.py @@ -19,8 +19,7 @@ class MultiDBTreeModel(MinimalTreeModel): """Base class for all tree models in Spine db editor.""" def __init__(self, db_editor, db_mngr, *db_maps): - """Init class. - + """ Args: db_editor (SpineDBEditor) db_mngr (SpineDBManager): A manager for the given db_maps diff --git a/spinetoolbox/spine_db_editor/mvcmodels/tree_model_base.py b/spinetoolbox/spine_db_editor/mvcmodels/tree_model_base.py index 412f6b185..bbf1d5db2 100644 --- a/spinetoolbox/spine_db_editor/mvcmodels/tree_model_base.py +++ b/spinetoolbox/spine_db_editor/mvcmodels/tree_model_base.py @@ -30,7 +30,7 @@ def __init__(self, db_editor, db_mngr, *db_maps): self.db_editor = db_editor self.db_mngr = db_mngr self.db_maps = db_maps - self.destroyed.connect(lambda _: self._tear_down_tree) + self.destroyed.connect(lambda _: self._invisible_root_item.tear_down_recursively()) def columnCount(self, parent=QModelIndex()): """Returns the number of columns under the given parent. Always 2. @@ -66,7 +66,3 @@ def db_item(item): def db_row(self, item): return self.db_item(item).child_number() - - def _tear_down_tree(self): - """Tears down tree items recursively""" - self._invisible_root_item.tear_down_recursively()