Make some extra logging statements and stuff to troubleshoot fit deletion bugs (#1199)

This commit is contained in:
Ryan Holmes
2017-05-30 22:57:52 -04:00
committed by GitHub
parent 4286f2ea5a
commit 45c3533501
5 changed files with 29 additions and 8 deletions

View File

@@ -1811,6 +1811,11 @@ class FitItem(SFItem.SFBrowserItem):
sFit = Fit.getInstance()
fit = sFit.getFit(self.fitID)
# 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)
sFit.deleteFit(self.fitID)
# Notify other areas that a fit has been deleted
@@ -1818,8 +1823,6 @@ 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:
if fit in self.shipBrowser.lastdata: # remove fit from import cache
self.shipBrowser.lastdata.remove(fit)
wx.PostEvent(self.shipBrowser, ImportSelected(fits=self.shipBrowser.lastdata))
elif self.shipBrowser.GetActiveStage() == 4:
wx.PostEvent(self.shipBrowser, SearchSelected(text=self.shipBrowser.navpanel.lastSearch, back=True))