diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index ac9f47f..edcfd11 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -246,8 +246,10 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const case UrlRole: return item.url(); case DisplayNameRole: { - if (item.isDesktopFile()) - return ""; + if (item.isDesktopFile()) { + KDesktopFile dfile(item.localPath()); + return dfile.readName(); + } return item.url().fileName(); } @@ -938,6 +940,12 @@ void FolderModel::openSelected() KFileItem item(url); QString mimeType = item.mimetype(); + // Desktop file. + if (mimeType == "application/x-desktop") { + FileLauncher::self()->launchApp(url.toLocalFile(), ""); + continue; + } + // runnable if (mimeType == "application/x-executable" || mimeType == "application/x-sharedlib" || diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index 473d792..3afd457 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -39,7 +39,7 @@ Item { property bool hovered: GridView.view.hoveredItem === control property bool selected: model.selected property bool blank: model.blank - property var fileName: model.fileName + property var fileName: model.displayName // For desktop visible: GridView.view.isDesktopView ? !blank : true @@ -207,7 +207,7 @@ Item { textFormat: Text.PlainText elide: Qt.ElideRight wrapMode: Text.Wrap - text: model.fileName + text: control.fileName color: control.GridView.view.isDesktopView ? "white" : selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor