@@ -22,6 +22,9 @@ class DesktopEntry: public QObject {
2222 Q_PROPERTY (QString name MEMBER mName CONSTANT);
2323 // / Short description of the application, such as "Web Browser". May be empty.
2424 Q_PROPERTY (QString genericName MEMBER mGenericName CONSTANT);
25+ // / Initial class or app id the app intends to use. May be useful for matching running apps
26+ // / to desktop entries.
27+ Q_PROPERTY (QString startupClass MEMBER mStartupClass CONSTANT);
2528 // / If true, this application should not be displayed in menus and launchers.
2629 Q_PROPERTY (bool noDisplay MEMBER mNoDisplay CONSTANT);
2730 // / Long description of the application, such as "View websites on the internet". May be empty.
@@ -81,6 +84,7 @@ class DesktopEntry: public QObject {
8184 QString mId ;
8285 QString mName ;
8386 QString mGenericName ;
87+ QString mStartupClass ;
8488 bool mNoDisplay = false ;
8589 QString mComment ;
8690 QString mIcon ;
@@ -151,6 +155,7 @@ class DesktopEntryManager: public QObject {
151155 void scanDesktopEntries ();
152156
153157 [[nodiscard]] DesktopEntry* byId (const QString& id);
158+ [[nodiscard]] DesktopEntry* heuristicLookup (const QString& name);
154159
155160 [[nodiscard]] ObjectModel<DesktopEntry>* applications ();
156161
@@ -186,7 +191,14 @@ class DesktopEntries: public QObject {
186191 explicit DesktopEntries ();
187192
188193 // / Look up a desktop entry by name. Includes NoDisplay entries. May return null.
194+ // /
195+ // / While this function requires an exact match, @@heuristicLookup() will correctly
196+ // / find an entry more often and is generally more useful.
189197 Q_INVOKABLE [[nodiscard]] static DesktopEntry* byId (const QString& id);
198+ // / Look up a desktop entry by name using heuristics. Unline @@byId(),
199+ // / if no exact matches are found this function will try to guess - potentially incorrectly.
200+ // / May return null.
201+ Q_INVOKABLE [[nodiscard]] static DesktopEntry* heuristicLookup (const QString& name);
190202
191203 [[nodiscard]] static ObjectModel<DesktopEntry>* applications ();
192204};
0 commit comments