-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import TextField-Only-enable-paste-action-if-clipboard-has-text.patch
- Loading branch information
1 parent
6c56b37
commit 0235748
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
qt6-declarative (6.6.1+dfsg-1deepin4) unstable; urgency=medium | ||
|
||
* Import patch from upstream: | ||
- TextField-Only-enable-paste-action-if-clipboard-has-text.patch | ||
https://codereview.qt-project.org/c/qt/qtdeclarative/+/535176 | ||
|
||
-- Tianyu Chen <[email protected]> Fri, 01 Mar 2024 10:16:35 +0800 | ||
|
||
qt6-declarative (6.6.1+dfsg-1deepin3) unstable; urgency=medium | ||
|
||
* Import patch from upstream: | ||
|
35 changes: 35 additions & 0 deletions
35
debian/patches/deepin-0005-TextField-Only-enable-paste-action-if-clipboard-has-text.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 580715fe586e49cf3fc85bb1c1d114d8e02ae625 Mon Sep 17 00:00:00 2001 | ||
From: Wang Fei <[email protected]> | ||
Date: Mon, 29 Jan 2024 13:43:17 +0800 | ||
Subject: [PATCH] TextField: Only enable paste action if clipboard has text | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=utf8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Regardless of whether the content of the system clipboard is empty, | ||
Paste Action was always enabled. Add a condition in canPaste that | ||
the clipboard has text, similar to what we do in Qt Widgets. | ||
|
||
Fixes: QTBUG-121594 | ||
Change-Id: I4b897c5ccea40229c4b8fc7d1d0da20540ed5ae1 | ||
Reviewed-by: Tor Arne Vestbø <[email protected]> | ||
--- | ||
src/quick/items/qquicktextinput.cpp | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp | ||
index 746942591b9..0acb4b38dc0 100644 | ||
--- a/src/quick/items/qquicktextinput.cpp | ||
+++ b/src/quick/items/qquicktextinput.cpp | ||
@@ -2587,7 +2587,7 @@ bool QQuickTextInput::canPaste() const | ||
Q_D(const QQuickTextInput); | ||
if (!d->canPasteValid) { | ||
if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData()) | ||
- const_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText(); | ||
+ const_cast<QQuickTextInputPrivate *>(d)->canPaste = !d->m_readOnly && mimeData->hasText() && !mimeData->text().isEmpty(); | ||
const_cast<QQuickTextInputPrivate *>(d)->canPasteValid = true; | ||
} | ||
return d->canPaste; | ||
-- | ||
2.16.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters