From 7ec936059fa05a2bf996162651a4b47e5e782af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDeljan=20Rikalo?= Date: Wed, 11 Sep 2024 13:57:20 +0000 Subject: [PATCH] Qt5,Qt6: allow paste text if mime type contains charset attribute (cherry picked from commit 9f0c74432d83d177bcb16751ab72cd6fbaefaccf) Co-authored-by: zeljan1 --- lcl/interfaces/qt5/qtobjects.pas | 2 +- lcl/interfaces/qt6/qtobjects.pas | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/qt5/qtobjects.pas b/lcl/interfaces/qt5/qtobjects.pas index f0762e50fc..5d60cd1678 100644 --- a/lcl/interfaces/qt5/qtobjects.pas +++ b/lcl/interfaces/qt5/qtobjects.pas @@ -4120,7 +4120,7 @@ begin if (MimeType = 'text/plain') then // do not translate begin QGuiApplication_platformName(@WStr); - if CompareText(Copy(UTF16ToUTF8(WStr), 1, 7),'wayland') = 0 then // do not translate + if (WStr = 'xcb') or (CompareText(Copy(UTF16ToUTF8(WStr), 1, 7),'wayland') = 0) then // do not translate begin AFormats := QStringList_Create; QMimeData_formats(QtMimeData, AFormats); diff --git a/lcl/interfaces/qt6/qtobjects.pas b/lcl/interfaces/qt6/qtobjects.pas index 768442a6a4..79a7045f14 100644 --- a/lcl/interfaces/qt6/qtobjects.pas +++ b/lcl/interfaces/qt6/qtobjects.pas @@ -4281,7 +4281,7 @@ begin if (MimeType = 'text/plain') then // do not translate begin QGuiApplication_platformName(@WStr); - if CompareText(Copy(UTF16ToUTF8(WStr), 1, 7),'wayland') = 0 then // do not translate + if (WStr = 'xcb') or (CompareText(Copy(UTF16ToUTF8(WStr), 1, 7),'wayland') = 0) then // do not translate begin AFormats := QStringList_Create; QMimeData_formats(QtMimeData, AFormats);