From 2d7eed4aac22a191c6a56372414121f166cce5b4 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 6 Feb 2018 00:36:57 -0500 Subject: [PATCH] Fix for #1355 - we were not properly deleting the fit from the list being passed into the Import event (which the history functionality piggy backs on). This also fixes the same bug with the import list. --- gui/builtinShipBrowser/fitItem.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/builtinShipBrowser/fitItem.py b/gui/builtinShipBrowser/fitItem.py index dca584929..60a05a62a 100644 --- a/gui/builtinShipBrowser/fitItem.py +++ b/gui/builtinShipBrowser/fitItem.py @@ -362,8 +362,10 @@ class FitItem(SFItem.SFBrowserItem): # need to delete from import cache before actually deleting fit if self.shipBrowser.GetActiveStage() == 5: - if fit in self.shipBrowser.lastdata: # remove fit from import cache - self.shipBrowser.lastdata.remove(fit) + for x in self.shipBrowser.lastdata: # remove fit from import cache + if x[0] == self.fitID: + self.shipBrowser.lastdata.remove(x) + break sFit.deleteFit(self.fitID) @@ -372,7 +374,7 @@ class FitItem(SFItem.SFBrowserItem): # todo: would a simple RefreshList() work here instead of posting that a stage has been selected? if self.shipBrowser.GetActiveStage() == 5: - wx.PostEvent(self.shipBrowser, events.ImportSelected(fits=self.shipBrowser.lastdata)) + wx.PostEvent(self.shipBrowser, events.ImportSelected(fits=self.shipBrowser.lastdata, recent=self.shipBrowser.recentFits)) elif self.shipBrowser.GetActiveStage() == 4: wx.PostEvent(self.shipBrowser, events.SearchSelected(text=self.shipBrowser.navpanel.lastSearch, back=True)) else: