Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2017-03-30 20:04:18 +02:00
commit e0c77231e0

View file

@ -1235,10 +1235,14 @@ class CuraApplication(QtApplication):
""" """
Checks if the given file URL is a valid project file. Checks if the given file URL is a valid project file.
""" """
file_path = QUrl(file_url).toLocalFile() try:
workspace_reader = self.getWorkspaceFileHandler().getReaderForFile(file_path) file_path = QUrl(file_url).toLocalFile()
if workspace_reader is None: workspace_reader = self.getWorkspaceFileHandler().getReaderForFile(file_path)
return False # non-project files won't get a reader if workspace_reader is None:
return False # non-project files won't get a reader
result = workspace_reader.preRead(file_path, show_dialog=False) result = workspace_reader.preRead(file_path, show_dialog=False)
return result == WorkspaceReader.PreReadResult.accepted return result == WorkspaceReader.PreReadResult.accepted
except Exception as e:
Logger.log("e", "Could not check file %s: %s", file_url, e)
return False