kiran-control-panel/0003-fix-shortcut-Filter-the-Exec-Key-when-reading-the-ex.patch
liuxinhao 7c1c085a0a 集成激活,重构代码,新增快捷键修复,修复内存泄漏
- 简要展示激活信息,提供激活信息入口
- 修复部分代码问题
- 调整控制中心弹窗按钮问题
- 修复快捷键 提取desktop entry Exec过滤%u,%f问题
- 修复检查出内存泄漏的问题
2022-11-14 19:04:00 +08:00

35 lines
1.1 KiB
Diff

From 4813ea776b59abbe2beacea74b310249402e48e7 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 14 Nov 2022 16:20:50 +0800
Subject: [PATCH 3/5] fix(shortcut): Filter the Exec Key when reading the exec
from the desktop entry
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
新增快捷键时从desktop entry读取exec时过滤掉Exec Key
---
plugins/keybinding/src/shortcut.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/keybinding/src/shortcut.cpp b/plugins/keybinding/src/shortcut.cpp
index f15d794..b3d4e1a 100644
--- a/plugins/keybinding/src/shortcut.cpp
+++ b/plugins/keybinding/src/shortcut.cpp
@@ -364,6 +364,12 @@ bool Shortcut::getExecFromDesktop(QString fileName, QString &exec)
if (str.isNull())
return false;
+ //移除掉无用的%f,%u,%F,%U
+ //https://specifications.freedesktop.org/desktop-entry-spec/1.1/ar01s06.html
+
+ str = str.replace("%f","",Qt::CaseInsensitive);
+ str = str.replace("%u","",Qt::CaseInsensitive);
+
exec = str;
return true;
}
--
2.33.0