Temproray files shouldn't be in recent file list.

CURA-7864
This commit is contained in:
Remco Burema 2021-01-08 13:44:23 +01:00
parent 96c4d66029
commit aa0a08500e
No known key found for this signature in database
GPG key ID: 215C49431D43F98C

View file

@ -1735,7 +1735,7 @@ class CuraApplication(QtApplication):
@pyqtSlot(QUrl, str) @pyqtSlot(QUrl, str)
@pyqtSlot(QUrl) @pyqtSlot(QUrl)
def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None): def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None, add_to_recent_files: str = True):
"""Open a local file """Open a local file
:param project_mode: How to handle project files. Either None(default): Follow user preference, "open_as_model" :param project_mode: How to handle project files. Either None(default): Follow user preference, "open_as_model"
@ -1760,7 +1760,7 @@ class CuraApplication(QtApplication):
if is_project_file and project_mode == "open_as_project": if is_project_file and project_mode == "open_as_project":
# open as project immediately without presenting a dialog # open as project immediately without presenting a dialog
workspace_handler = self.getWorkspaceFileHandler() workspace_handler = self.getWorkspaceFileHandler()
workspace_handler.readLocalFile(file) workspace_handler.readLocalFile(file, add_to_recent_files = add_to_recent_files)
return return
if is_project_file and project_mode == "always_ask": if is_project_file and project_mode == "always_ask":
@ -1801,7 +1801,7 @@ class CuraApplication(QtApplication):
if extension in self._non_sliceable_extensions: if extension in self._non_sliceable_extensions:
self.deleteAll(only_selectable = False) self.deleteAll(only_selectable = False)
job = ReadMeshJob(f) job = ReadMeshJob(f, add_to_recent_files = add_to_recent_files)
job.finished.connect(self._readMeshFinished) job.finished.connect(self._readMeshFinished)
job.start() job.start()