Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Traceback after purging data from Data store properties #2992

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions spinetoolbox/spine_db_editor/mvcmodels/tree_model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()