From 661fb16fef578d4c6ae844b492a675d8d6a92237 Mon Sep 17 00:00:00 2001 From: zhaofangxun Date: Wed, 26 Aug 2026 11:53:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20AppGroup::parseGroupId=20off-by-one=20sl?= =?UTF-8?q?ice=20error=20(mid(len+1)=20=E2=86=92=20mid(len))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "internal/folder/" is 16 characters (indices 0-15), so the folder number starts at index 16. mid(len + 1) = mid(17) skipped the first digit, causing all non-zero folder IDs to parse incorrectly (e.g. "internal/folder/123" → 23 instead of 123). Folder 0 was incidentally correct because mid(17) yielded an empty string → toInt() = 0. Change mid(len + 1) to mid(len) so slicing starts at the correct position. Closes: DDE-143 --- applets/dde-apps/appgroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applets/dde-apps/appgroup.cpp b/applets/dde-apps/appgroup.cpp index c37a6125f..0f9df3029 100644 --- a/applets/dde-apps/appgroup.cpp +++ b/applets/dde-apps/appgroup.cpp @@ -61,7 +61,7 @@ int AppGroup::parseGroupId(const QString & id) { using namespace std::string_view_literals; constexpr size_t len = "internal/folder/"sv.size(); - return QStringView{id}.mid(len + 1).toInt(); + return QStringView{id}.mid(len).toInt(); } void AppGroup::setItemsPerPage(int number)