From 60e7392b6a66d269e72d40ecef0aab130b10b886 Mon Sep 17 00:00:00 2001 From: groveer Date: Tue, 27 Aug 2024 09:17:09 +0800 Subject: [PATCH] fix(util): error appid from `getAppIdFromAbsolutePath` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log: tmp变量读出来的字符串多带了一个字符 --- include/util/dutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util/dutil.h b/include/util/dutil.h index 999827b2..4353b854 100644 --- a/include/util/dutil.h +++ b/include/util/dutil.h @@ -96,7 +96,7 @@ inline QString getAppIdFromAbsolutePath(const QString &path) return {}; } - auto tmp = path.chopped(desktopSuffix.size() - 1); + auto tmp = path.chopped(desktopSuffix.size()); auto components = tmp.split(QDir::separator(), Qt::SkipEmptyParts); auto location = std::find(components.cbegin(), components.cend(), "applications"); if (location == components.cend()) {