aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp')
-rw-r--r--src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp b/src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp
index da899140b7..5d4023a8cf 100644
--- a/src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp
+++ b/src/quickdialogs2/quickdialogs2/qquickfiledialog.cpp
@@ -576,8 +576,13 @@ QUrl QQuickFileDialog::addDefaultSuffix(const QUrl &file) const
QUrl url = file;
const QString path = url.path();
const QString suffix = m_options->defaultSuffix();
- if (!suffix.isEmpty() && !path.endsWith(QLatin1Char('/')) && path.lastIndexOf(QLatin1Char('.')) == -1)
+ // Urls with "content" scheme do not require suffixes. Such schemes are
+ // used on Android.
+ const bool isContentScheme = url.scheme() == u"content"_qs;
+ if (!isContentScheme && !suffix.isEmpty() && !path.endsWith(QLatin1Char('/'))
+ && path.lastIndexOf(QLatin1Char('.')) == -1) {
url.setPath(path + QLatin1Char('.') + suffix);
+ }
return url;
}