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>
bb10
parent
15c9fb4013
commit
3e89183c67
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue