remove tmp file when closing with menu action

This commit is contained in:
2021-10-27 09:11:25 +02:00
parent 5a4299ef84
commit 8cfa518d93
2 changed files with 9 additions and 8 deletions

View File

@@ -10,8 +10,8 @@ from fulltabwidget import FullTabWidget
from logFileModel import LogFileModel
from settings import Settings
class Tabs(QWidget):
class Tabs(QWidget):
tabs_by_index = {}
tabs_by_filename = {}
@@ -42,7 +42,7 @@ class Tabs(QWidget):
if model.get_file() in self.tabs_by_filename:
for tab_index in range(0, self.tabs.count()):
widget : FullTabWidget = self.tabs.widget(tab_index)
widget: FullTabWidget = self.tabs.widget(tab_index)
if widget.get_file() == model.get_file():
self.tabs.setCurrentIndex(tab_index)
break
@@ -57,4 +57,6 @@ class Tabs(QWidget):
del self.tabs_by_filename[full_tab.file_view.get_file()]
self.tabs.removeTab(tab_index)
def destruct(self):
while self.tabs.count() > 0:
self._close_tab(0)