diff options
author | Adam Kallai <kadam@inf.u-szeged.hu> | 2015-02-05 15:06:59 +0100 |
---|---|---|
committer | Adam Kallai <kadam@inf.u-szeged.hu> | 2015-02-06 11:53:00 +0000 |
commit | dd450a1006c6975014f95dcb93395e961945c4f2 (patch) | |
tree | 11e2c027de2a44e23b4b249a40c31d1aaa72d392 | |
parent | 1a744ca48513fe8aaa8edb31adfa534effb89683 (diff) |
Revert the QJSValue parameter type in UIDelegate
The mapping of var signal parameters to QJSValue was reverted
in qtdeclarative, commit 605777e6cf557dbaf2835c63562bf3fe1620ee45.
Change the FilePickerController::accepted() slot parameter type from
QJSValue to QVariant in UIDelegate.
Task-number: QTBUG-44307
Change-Id: I373b37b6eb4c32e91fd92701ecad685eab9cb804
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r-- | src/webengine/ui_delegates_manager.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 48e1bee7e..ed4d59bfd 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -342,7 +342,7 @@ public: FilePickerController(WebContentsAdapterClient::FileChooserMode, const QExplicitlySharedDataPointer<WebContentsAdapter> &, QObject * = 0); public Q_SLOTS: - void accepted(const QJSValue &files); + void accepted(const QVariant &files); void rejected(); private: @@ -359,14 +359,11 @@ FilePickerController::FilePickerController(WebContentsAdapterClient::FileChooser { } -void FilePickerController::accepted(const QJSValue &filesValue) +void FilePickerController::accepted(const QVariant &files) { QStringList stringList; - int length = filesValue.property(QStringLiteral("length")).toInt(); - for (int i = 0; i < length; i++) { - stringList.append(QUrl(filesValue.property(i).toString()).toLocalFile()); - } - + Q_FOREACH (const QUrl &url, files.value<QList<QUrl> >()) + stringList.append(url.toLocalFile()); m_adapter->filesSelectedInChooser(stringList, m_mode); } @@ -415,7 +412,7 @@ void UIDelegatesManager::showFilePicker(WebContentsAdapterClient::FileChooserMod CHECK_QML_SIGNAL_PROPERTY(filesPickedSignal, filePickerComponent->url()); QQmlProperty rejectSignal(filePicker, QStringLiteral("onRejected")); CHECK_QML_SIGNAL_PROPERTY(rejectSignal, filePickerComponent->url()); - static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QJSValue)"); + static int acceptedIndex = controller->metaObject()->indexOfSlot("accepted(QVariant)"); QObject::connect(filePicker, filesPickedSignal.method(), controller, controller->metaObject()->method(acceptedIndex)); static int rejectedIndex = controller->metaObject()->indexOfSlot("rejected()"); QObject::connect(filePicker, rejectSignal.method(), controller, controller->metaObject()->method(rejectedIndex)); |