1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-18 22:45:25 +02:00

messagesadapter: show clipboard image correctly in chatview

For example, with the fix, image copied from web or snipping tool
should show correctly in data_transfer_send_container of chatview

Change-Id: Ie86e7c2a5ef042ae43acd4a8f1d2ebc9641385e3
This commit is contained in:
Ming Rui Zhang 2020-11-18 11:58:09 -05:00
parent e4af2bef7e
commit d73422f612

View file

@ -393,7 +393,7 @@ MessagesAdapter::pasteKeyDetected()
QBuffer bu(&ba);
bu.open(QIODevice::WriteOnly);
pixmap.save(&bu, "PNG");
auto str = QString::fromLocal8Bit(ba.toBase64());
auto str = QString::fromLatin1(ba.toBase64().data());
setMessagesImageContent(str, true);
} else if (mimeData->hasUrls()) {
@ -590,7 +590,7 @@ void
MessagesAdapter::setMessagesImageContent(const QString& path, bool isBased64)
{
if (isBased64) {
QString param = QString("addImage_base64('file://%1')").arg(path);
QString param = QString("addImage_base64('%1')").arg(path);
QMetaObject::invokeMethod(qmlObj_, "webViewRunJavaScript", Q_ARG(QVariant, param));
} else {
QString param = QString("addImage_path('file://%1')").arg(path);