summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-02-14 14:24:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-06 20:48:59 +0100
commit3e89183c6709f4ac73533e85a86394f3ed30c445 (patch)
treed34632011dd49457b8c478c02aa97c6c9c59c9ed
parent15c9fb401316991f4c26ff883c078648614ce6af (diff)
qmacmime: bugfix unicode::canConvert
The UnicodeText converter is a bit special since it can convert to both utf8 and utf16 for text/plain. But since flavorFor("text/plain") can only return one UTI, it returns utf16. And this means that canConvert will return false if given utf8 as argument. On iOS this is often the only format available on the pasteboard, which means that pasting text from another app app will fail. This patch will ensure that it returns true for both utf8 and utf16. Change-Id: I31697f1815c19113393a8ef48f2ead4d7f1078ec Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
-rw-r--r--src/platformsupport/clipboard/qmacmime.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm
index adddabb7df..93d897503b 100644
--- a/src/platformsupport/clipboard/qmacmime.mm
+++ b/src/platformsupport/clipboard/qmacmime.mm
@@ -388,7 +388,8 @@ QString QMacPasteboardMimeUnicodeText::mimeFor(QString flav)
bool QMacPasteboardMimeUnicodeText::canConvert(const QString &mime, QString flav)
{
- return flavorFor(mime) == flav;
+ return (mime == QLatin1String("text/plain")
+ && (flav == QLatin1String("public.utf8-plain-text") || (flav == QLatin1String("public.utf16-plain-text"))));
}
QVariant QMacPasteboardMimeUnicodeText::convertToMime(const QString &mimetype, QList<QByteArray> data, QString flavor)