summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Engelmann <viktor.engelmann@qt.io>2016-10-07 13:39:47 +0200
committerViktor Engelmann <viktor.engelmann@qt.io>2016-10-11 09:43:40 +0000
commitcdfa03ad7472eb374b2434926d058cf570bc4e37 (patch)
tree895a7a627d96f65a96ab7e581acee82b0c38fab5
parentfe8ae4b78065916e1882aaedc5994d66a8456df4 (diff)
Consider multiple contents in mimeDataFromDropData conversion
content::DropData can have multiple contents (e.g. an <img> tag has itself as .html property, but also the src="..." attribute as .url property. Therefore, we should always consider all 3 cases and not return immediately when we have found the first content. Task-number: QTBUG-55858 Change-Id: Ie13851e8edb9ada45184a19b6ccfe38839bb9923 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/web_contents_adapter.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index bfac6a5b2..7285648fd 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1059,18 +1059,12 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId)
static QMimeData *mimeDataFromDropData(const content::DropData &dropData)
{
QMimeData *mimeData = new QMimeData();
- if (!dropData.text.is_null()) {
+ if (!dropData.text.is_null())
mimeData->setText(toQt(dropData.text.string()));
- return mimeData;
- }
- if (!dropData.html.is_null()) {
+ if (!dropData.html.is_null())
mimeData->setHtml(toQt(dropData.html.string()));
- return mimeData;
- }
- if (dropData.url.is_valid()) {
+ if (dropData.url.is_valid())
mimeData->setUrls(QList<QUrl>() << toQt(dropData.url));
- return mimeData;
- }
return mimeData;
}