增加正则表达式转义,避免偶现的搜索UI卡死现象。

This commit is contained in:
iaom 2022-07-15 11:47:39 +08:00 committed by cckylin-cibot
parent ea7b964df8
commit 20cfb61703
2 changed files with 30 additions and 0 deletions

29
debian/patches/0007-UI.patch vendored Normal file
View File

@ -0,0 +1,29 @@
From: iaom <zhangpengfei@kylinos.cn>
Date: Fri, 15 Jul 2022 11:47:39 +0800
Subject: =?utf-8?b?5aKe5Yqg5q2j5YiZ6KGo6L6+5byP6L2s5LmJ77yM6YG/5YWN5YG2546w?=
=?utf-8?b?55qE5pCc57SiVUnljaHmrbvnjrDosaHjgII=?=
---
frontend/view/result-view-delegate.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/view/result-view-delegate.cpp b/frontend/view/result-view-delegate.cpp
index 17e3346..c9095a3 100644
--- a/frontend/view/result-view-delegate.cpp
+++ b/frontend/view/result-view-delegate.cpp
@@ -228,6 +228,7 @@ void ResultItemStyle::drawControl(QStyle::ControlElement element, const QStyleOp
HightLightEffectHelper::HightLightEffectHelper(QObject *parent) : QSyntaxHighlighter(parent)
{
m_expression.setCaseSensitivity(Qt::CaseInsensitive);
+ m_expression.setPatternSyntax(QRegExp::FixedString);
}
void HightLightEffectHelper::setExpression(const QString &text)
@@ -243,7 +244,6 @@ void HightLightEffectHelper::setTextColor(const QBrush &brush)
void HightLightEffectHelper::highlightBlock(const QString &text)
{
setFormat(0, text.length(), m_textCharFormat);
-
m_textCharFormat.setFontWeight(QFont::Bold);
int index = text.indexOf(m_expression);
while(index >= 0){

View File

@ -4,3 +4,4 @@
0004-4-UI-Add-a-mainWindow-switch-dbus-interface.-Fix-125.patch 0004-4-UI-Add-a-mainWindow-switch-dbus-interface.-Fix-125.patch
0005-Fix-bug-127732-bug-127792-the-ukui-search-do-not-qui.patch 0005-Fix-bug-127732-bug-127792-the-ukui-search-do-not-qui.patch
0006-copyright.patch 0006-copyright.patch
0007-UI.patch