From 5da31230c72ce05891bcb1ec0adec86992a64940 Mon Sep 17 00:00:00 2001 From: Jan Wester Date: Fri, 9 Aug 2019 16:43:17 +0200 Subject: [PATCH] Fixed crash for pre-Qt5.6 Qt has garbage documentation. I dug into Qt 5.0 source code to make sure the crashing call can be safely left out for older versions, and that is indeed the case. setSupportedSchemes() appears to be introduced together with the future to select non-local files in the dialog, but we only cared about local files to begin with. --- manuskript/functions/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manuskript/functions/__init__.py b/manuskript/functions/__init__.py index 51ee43ba..53eb519c 100644 --- a/manuskript/functions/__init__.py +++ b/manuskript/functions/__init__.py @@ -399,7 +399,8 @@ def getSaveFileNameWithSuffix(parent, caption, directory, filter, options=None, if defaultSuffix: dialog.setDefaultSuffix(defaultSuffix) dialog.setFileMode(QFileDialog.AnyFile) - dialog.setSupportedSchemes(("file",)) + if hasattr(dialog, 'setSupportedSchemes'): # Pre-Qt5.6 lacks this. + dialog.setSupportedSchemes(("file",)) dialog.setAcceptMode(QFileDialog.AcceptSave) if selectedFilter: dialog.selectNameFilter(selectedFilter)