From 7551ff92b95478f1c89d89d6b98ea9e693b49d32 Mon Sep 17 00:00:00 2001 From: kateleet Date: Wed, 15 Dec 2021 03:52:44 +0800 Subject: [PATCH] Fix desktop file display name --- model/foldermodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index edcfd11..f7e2644 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -248,7 +248,9 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const case DisplayNameRole: { if (item.isDesktopFile()) { KDesktopFile dfile(item.localPath()); - return dfile.readName(); + + if (!dfile.readName().isEmpty()) + return dfile.readName(); } return item.url().fileName();