1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 04:42:05 -04:00

launcher: always heuristic lookup cached entries

This commit is contained in:
bbedward
2026-02-18 23:47:00 -05:00
parent c67bb1444a
commit 68e10934e4

View File

@@ -1614,25 +1614,41 @@ Item {
itemExecuted(); itemExecuted();
} }
function launchApp(app) { function _resolveDesktopEntry(app) {
if (!app) if (!app)
return null;
if (app.command)
return app;
var id = app.id || app.execString || app.exec || "";
if (!id)
return null;
return DesktopEntries.heuristicLookup(id);
}
function launchApp(app) {
var entry = _resolveDesktopEntry(app);
if (!entry)
return; return;
SessionService.launchDesktopEntry(app); SessionService.launchDesktopEntry(entry);
AppUsageHistoryData.addAppUsage(app); AppUsageHistoryData.addAppUsage(entry);
} }
function launchAppWithNvidia(app) { function launchAppWithNvidia(app) {
if (!app) var entry = _resolveDesktopEntry(app);
if (!entry)
return; return;
SessionService.launchDesktopEntry(app, true); SessionService.launchDesktopEntry(entry, true);
AppUsageHistoryData.addAppUsage(app); AppUsageHistoryData.addAppUsage(entry);
} }
function launchAppAction(actionItem) { function launchAppAction(actionItem) {
if (!actionItem || !actionItem.parentApp || !actionItem.actionData) if (!actionItem || !actionItem.actionData)
return; return;
SessionService.launchDesktopAction(actionItem.parentApp, actionItem.actionData); var entry = _resolveDesktopEntry(actionItem.parentApp);
AppUsageHistoryData.addAppUsage(actionItem.parentApp); if (!entry)
return;
SessionService.launchDesktopAction(entry, actionItem.actionData);
AppUsageHistoryData.addAppUsage(entry);
} }
function openFile(path) { function openFile(path) {