summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins.qnx@kdab.com>2013-04-16 09:42:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-17 02:22:50 +0200
commit893deb1a93021cdfabe038cdf1869de33a60cbc9 (patch)
tree152966dbfbb155726aaad07f4ad5c20b8a42b7ff /src/plugins/platforms/qnx
parent92d8e7c315a8aad0864347a9dd564f903edd76a3 (diff)
QNX: Fix filenames returned by the file dialog.
QUrl prefixes like file:// should be used. QFileDialog will use QFileInfo later on, and that doesn't support QUrl prefixes. Change-Id: I8f6d2fb9a4f502cff030a1cdd43b047b8ed5a120 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qqnxfilepicker.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/qnx/qqnxfilepicker.cpp b/src/plugins/platforms/qnx/qqnxfilepicker.cpp
index 9326a23b98..5229d1f1f5 100644
--- a/src/plugins/platforms/qnx/qqnxfilepicker.cpp
+++ b/src/plugins/platforms/qnx/qqnxfilepicker.cpp
@@ -48,6 +48,7 @@
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonParseError>
+#include <QUrl>
#include <bps/navigator.h>
#include <bps/navigator_invoke.h>
@@ -258,12 +259,13 @@ void QQnxFilePicker::handleFilePickerResponse(const char *data)
foreach (const QVariant &variant, array) {
const QJsonObject object = QJsonObject::fromVariantMap(variant.toMap());
- const QString uri = object.value(QStringLiteral("uri")).toString();
+ const QUrl url(object.value(QStringLiteral("uri")).toString());
+ const QString localFile = url.toLocalFile(); // strip "file://"
- if (!uri.isEmpty())
- m_selectedFiles << uri;
+ if (!localFile.isEmpty())
+ m_selectedFiles << localFile;
- qFilePickerDebug() << "FilePicker uri response:" << uri;
+ qFilePickerDebug() << "FilePicker uri response:" << localFile;
}
Q_EMIT closed();