Skip to content

Commit

Permalink
Proper disabling of unticked KML files.
Browse files Browse the repository at this point in the history
Fix #1866
  • Loading branch information
joernu76 committed Aug 9, 2023
1 parent ec2df5d commit 4d54708
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mslib/msui/kmloverlay_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def __init__(self, parent=None, view=None):

def update(self):
for entry in self.dict_files.values():
entry["patch"].update()
if entry["patch"] is not None:
entry["patch"].update()

def save_settings(self):
for entry in self.dict_files.values():
Expand Down Expand Up @@ -525,6 +526,7 @@ def remove_file(self): # removes checked files
self.listWidget.item(index).checkState() == QtCore.Qt.Checked): # if file is checked
if self.dict_files[self.listWidget.item(index).text()]["patch"] is not None:
self.dict_files[self.listWidget.item(index).text()]["patch"].remove() # remove patch object
self.dict_files[self.listWidget.item(index).text()]["patch"] = None # remove patch object
del self.dict_files[self.listWidget.item(index).text()] # del the checked files from dictionary
self.listWidget.takeItem(index) # remove file item from ListWidget
self.remove_file() # recursively since count of for loop changes every iteration due to del of items))
Expand All @@ -542,6 +544,7 @@ def load_file(self):
for entry in self.dict_files.values(): # removes all patches from map, but not from dict_flighttrack
if entry["patch"] is not None: # since newly initialized files will have patch:None
entry["patch"].remove()
entry["patch"] = None

for index in range(self.listWidget.count()):
if hasattr(self.listWidget.item(index), "checkState") and (
Expand Down

0 comments on commit 4d54708

Please sign in to comment.