From 4813ea776b59abbe2beacea74b310249402e48e7 Mon Sep 17 00:00:00 2001 From: liuxinhao 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