From aa7762c1761eaf697b428405e666d284cb184141 Mon Sep 17 00:00:00 2001 From: kateleet Date: Thu, 23 Dec 2021 11:38:27 +0800 Subject: [PATCH] fix: fixed item from launcher --- src/applicationmodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/applicationmodel.cpp b/src/applicationmodel.cpp index 8e70fe4..3a355c3 100644 --- a/src/applicationmodel.cpp +++ b/src/applicationmodel.cpp @@ -107,8 +107,11 @@ void ApplicationModel::addItem(const QString &desktopFile) item->desktopPath = desktopFile; item->isPinned = true; - // First use exec as the id of the item. - item->id = desktopInfo.value("Exec"); + // First use filename as the id of the item. + // Why not use exec? Because exec contains the file path, + // QSettings will have problems, resulting in unrecognized next time. + QFileInfo fi(desktopFile); + item->id = fi.baseName(); m_appItems << item; endInsertRows();