diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-05-16 16:02:13 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-06-06 12:58:25 +0000 |
commit | f0b8c0e336d8c839e6fcc0459cc12305df212559 (patch) | |
tree | e53f4551e252ea0cf359739afdadd7b41d1c72ee /src/core/web_contents_adapter.cpp | |
parent | 9edbe46b9932149a6eaad18530d50c1c4187f67d (diff) |
Fix QMimeData to content::DropData conversion
When files are dropped then it's expected that dataTransfer.files and
dataTransfer.items have the same amount of entries. That means that
whenever QMimeData contains files we must only convert those and ignore
the rest.
But while files do not allow other items before them, text and URLs may
co-exist in content::DropData.
This is consistent with the behavior of Chromium and Firefox and what
web pages expect.
Task-number: QTBUG-59690
Change-Id: Iad56aac3e071dcfa09fa5dfcc788c1c54c6eeae6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 444429c75..8430ff710 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1229,7 +1229,7 @@ static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeDat return; if (mimeData->hasHtml()) dropData->html = toNullableString16(mimeData->html()); - else if (mimeData->hasText()) + if (mimeData->hasText()) dropData->text = toNullableString16(mimeData->text()); } |