Commit 4f88bd08 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[filechooser] Make sure outgoing URIs are encoded

URIs are expected to be encoded. e.g. spaces are replaced by %20

See https://github.com/flatpak/xdg-desktop-portal/issues/799

BUG: 454850
parent 09916db1
Pipeline #185947 passed with stage
in 54 seconds
......@@ -285,7 +285,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
return 2;
}
results.insert(QStringLiteral("uris"), QUrl::toStringList(urls));
results.insert(QStringLiteral("uris"), QUrl::toStringList(urls, QUrl::FullyEncoded));
results.insert(QStringLiteral("writable"), true);
return 0;
......@@ -330,7 +330,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
return 2;
}
results.insert(QStringLiteral("uris"), QUrl::toStringList(urls));
results.insert(QStringLiteral("uris"), QUrl::toStringList(urls, QUrl::FullyEncoded));
results.insert(QStringLiteral("writable"), true);
if (optionsWidget) {
......
......@@ -187,7 +187,7 @@ uint MobileFileDialog::exec()
const auto acceptedConn = connect(m_callback, &FileChooserQmlCallback::accepted, this, [this, &exitCode, &handled](const QStringList &urls) {
for (const auto &filename : urls) {
m_results << QUrl(filename).toDisplayString();
m_results << QUrl(filename).toString(QUrl::FullyEncoded);
}
handled = true;
exitCode = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment