fix(util): error appid from `getAppIdFromAbsolutePath`

Log: tmp变量读出来的字符串多带了一个字符
This commit is contained in:
groveer 2024-08-27 09:17:09 +08:00 committed by mike
parent 40cbafcf8f
commit 280791db27
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ inline QString getAppIdFromAbsolutePath(const QString &path)
return {}; return {};
} }
auto tmp = path.chopped(desktopSuffix.size() - 1); auto tmp = path.chopped(desktopSuffix.size());
auto components = tmp.split(QDir::separator(), Qt::SkipEmptyParts); auto components = tmp.split(QDir::separator(), Qt::SkipEmptyParts);
auto location = std::find(components.cbegin(), components.cend(), "applications"); auto location = std::find(components.cbegin(), components.cend(), "applications");
if (location == components.cend()) { if (location == components.cend()) {