Move the cleanup() function from Onionshare class to Web class, so that the list of files to be cleaned up is always available (needed for website temp files)

This commit is contained in:
Miguel Jacq 2021-05-04 16:21:42 +10:00
parent e48b300ff9
commit ff5e73a2ae
10 changed files with 40 additions and 38 deletions

View file

@ -382,7 +382,7 @@ class Mode(QtWidgets.QWidget):
except Exception:
# Probably we had no port to begin with (Onion service didn't start)
pass
self.app.cleanup()
self.web.cleanup()
self.stop_server_custom()

View file

@ -47,7 +47,7 @@ class CompressThread(QtCore.QThread):
self.mode.filenames, processed_size_callback=self.set_processed_size
)
self.success.emit()
self.mode.app.cleanup_filenames += (
self.mode.web.cleanup_filenames += (
self.mode.web.share_mode.cleanup_filenames
)
except OSError as e:

View file

@ -668,7 +668,7 @@ class Tab(QtWidgets.QWidget):
if self.close_dialog.clickedButton() == self.close_dialog.accept_button:
self.common.log("Tab", "close_tab", "close, closing tab")
self.get_mode().stop_server()
self.app.cleanup()
mode.web.cleanup()
return True
# Cancel
else:
@ -681,4 +681,4 @@ class Tab(QtWidgets.QWidget):
self.get_mode().web.stop(self.get_mode().app.port)
self.get_mode().web_thread.quit()
self.get_mode().web_thread.wait()
self.app.cleanup()
self.get_mode().web.cleanup()