Skip to content

Commit

Permalink
Try deleting by tab id not model id.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Dec 17, 2024
1 parent 8864264 commit 042cfc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sas/qtgui/MainWindow/DataExplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ def updateTheoryFromPerspective(self, model_item):
self.theory_model.appendRow(model_item)
return model_item

def deleteIntermediateTheoryPlotsByModelID(self, model_id):
def deleteIntermediateTheoryPlotsByModelID(self, tab_id):
"""Given a model's ID, deletes all items in the theory item model which reference the same ID. Useful in the
case of intermediate results disappearing when changing calculations (in which case you don't want them to be
retained in the list)."""
Expand All @@ -2077,8 +2077,8 @@ def deleteIntermediateTheoryPlotsByModelID(self, model_id):
return
match = GuiUtils.theory_plot_ID_pattern.match(data.id)
if match:
item_model_id = match.groups()[-1]
if item_model_id == model_id:
item_tab_id = match.groups()[0]
if item_tab_id == tab_id:
# Only delete those identified as an intermediate plot
if match.groups()[2] not in (None, ""):
items_to_delete.append(item)
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3287,7 +3287,7 @@ def complete1D(self, return_data):
else:
# delete theory items for the model, in order to get rid of any
# redundant items, e.g. beta(Q), S_eff(Q)
self.communicate.deleteIntermediateTheoryPlotsSignal.emit(self.kernel_module.id)
self.communicate.deleteIntermediateTheoryPlotsSignal.emit(self.tab_id)

self._appendPlotsPolyDisp(new_plots, return_data, fitted_data)

Expand Down

0 comments on commit 042cfc9

Please sign in to comment.