summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/clipboard/qmacmime.mm
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-11-09 10:34:33 +0100
committerLiang Qi <liang.qi@qt.io>2018-11-09 10:34:33 +0100
commitbc07958f922519bca1acc5930498ee0273576699 (patch)
treed5fda8e4458c2543458dbaeb7f4830c6d4750954 /src/platformsupport/clipboard/qmacmime.mm
parentb01a53fe328b37324c6e3ab38c50f156c93c6afe (diff)
parentdec7961709c90f6977d2447f7fa6c6625af41cb2 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
Diffstat (limited to 'src/platformsupport/clipboard/qmacmime.mm')
-rw-r--r--src/platformsupport/clipboard/qmacmime.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm
index caa2ccc6e5..f425e34b39 100644
--- a/src/platformsupport/clipboard/qmacmime.mm
+++ b/src/platformsupport/clipboard/qmacmime.mm
@@ -418,8 +418,10 @@ QVariant QMacPasteboardMimeUnicodeText::convertToMime(const QString &mimetype, Q
QVariant ret;
if (flavor == QLatin1String("public.utf8-plain-text")) {
ret = QString::fromUtf8(firstData);
+#if QT_CONFIG(textcodec)
} else if (flavor == QLatin1String("public.utf16-plain-text")) {
ret = QTextCodec::codecForName("UTF-16")->toUnicode(firstData);
+#endif
} else {
qWarning("QMime::convertToMime: unhandled mimetype: %s", qPrintable(mimetype));
}
@@ -432,8 +434,10 @@ QList<QByteArray> QMacPasteboardMimeUnicodeText::convertFromMime(const QString &
QString string = data.toString();
if (flavor == QLatin1String("public.utf8-plain-text"))
ret.append(string.toUtf8());
+#if QT_CONFIG(textcodec)
else if (flavor == QLatin1String("public.utf16-plain-text"))
ret.append(QTextCodec::codecForName("UTF-16")->fromUnicode(string));
+#endif
return ret;
}