From 7591abbe0402d7fcb6305728c1456c1e148d1c40 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Fri, 7 Mar 2014 11:54:26 +0100 Subject: [PATCH] BlackBerry: Repair the file picker The interface for invoking the file dialog has been changed. Instead of a Json object we now passing a pps object to the invoke target. Change-Id: I3c5bc8f0e1af1a84d4afb6bc1923f23db2b43d5e Reviewed-by: Kevin Krammer Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxfilepicker.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxfilepicker.cpp b/src/plugins/platforms/qnx/qqnxfilepicker.cpp index 56c804a5b4..843b035037 100644 --- a/src/plugins/platforms/qnx/qqnxfilepicker.cpp +++ b/src/plugins/platforms/qnx/qqnxfilepicker.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -132,11 +133,16 @@ void QQnxFilePicker::open() if (!m_filters.isEmpty()) map[QStringLiteral("Filter")] = m_filters.join(";"); + QByteArray ppsData; +#if defined(Q_OS_BLACKBERRY_TABLET) QJsonDocument document; document.setObject(QJsonObject::fromVariantMap(map)); - const QByteArray jsonData = document.toJson(QJsonDocument::Compact); + ppsData = document.toJson(QJsonDocument::Compact); +#else + ppsData = QPpsObject::encode(map); +#endif - errorCode = navigator_invoke_invocation_set_data(m_invocationHandle, jsonData.constData(), jsonData.size()); + errorCode = navigator_invoke_invocation_set_data(m_invocationHandle, ppsData.constData(), ppsData.size()); if (errorCode != BPS_SUCCESS) { cleanup(); qWarning() << "QQnxFilePicker: unable to set data:" << strerror(errno);