From cdfa03ad7472eb374b2434926d058cf570bc4e37 Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Fri, 7 Oct 2016 13:39:47 +0200 Subject: Consider multiple contents in mimeDataFromDropData conversion content::DropData can have multiple contents (e.g. an 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 --- src/core/web_contents_adapter.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src') 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() << toQt(dropData.url)); - return mimeData; - } return mimeData; } -- cgit v1.2.3