mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 16:52:10 -04:00
launcher v2: always heuristicLookup tab actions
This commit is contained in:
@@ -56,11 +56,6 @@ Rectangle {
|
|||||||
case "app":
|
case "app":
|
||||||
if (selectedItem?.isCore)
|
if (selectedItem?.isCore)
|
||||||
break;
|
break;
|
||||||
if (selectedItem?.actions) {
|
|
||||||
for (var i = 0; i < selectedItem.actions.length; i++) {
|
|
||||||
result.push(selectedItem.actions[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (SessionService.nvidiaCommand) {
|
if (SessionService.nvidiaCommand) {
|
||||||
result.push({
|
result.push({
|
||||||
name: I18n.tr("Launch on dGPU"),
|
name: I18n.tr("Launch on dGPU"),
|
||||||
@@ -68,6 +63,11 @@ Rectangle {
|
|||||||
action: "launch_dgpu"
|
action: "launch_dgpu"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (selectedItem?.actions) {
|
||||||
|
for (var i = 0; i < selectedItem.actions.length; i++) {
|
||||||
|
result.push(selectedItem.actions[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1250,6 +1250,23 @@ Item {
|
|||||||
CacheData.saveLauncherCache(serializable);
|
CacheData.saveLauncherCache(serializable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _actionsFromDesktopEntry(appId) {
|
||||||
|
if (!appId)
|
||||||
|
return [];
|
||||||
|
var entry = DesktopEntries.heuristicLookup(appId);
|
||||||
|
if (!entry || !entry.actions || entry.actions.length === 0)
|
||||||
|
return [];
|
||||||
|
var result = [];
|
||||||
|
for (var i = 0; i < entry.actions.length; i++) {
|
||||||
|
result.push({
|
||||||
|
name: entry.actions[i].name,
|
||||||
|
icon: "play_arrow",
|
||||||
|
actionData: entry.actions[i]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
function _loadDiskCache() {
|
function _loadDiskCache() {
|
||||||
var cached = CacheData.loadLauncherCache();
|
var cached = CacheData.loadLauncherCache();
|
||||||
if (!cached || !Array.isArray(cached) || cached.length === 0)
|
if (!cached || !Array.isArray(cached) || cached.length === 0)
|
||||||
@@ -1277,8 +1294,12 @@ Item {
|
|||||||
data: {
|
data: {
|
||||||
id: it.id
|
id: it.id
|
||||||
},
|
},
|
||||||
actions: [],
|
actions: _actionsFromDesktopEntry(it.id),
|
||||||
primaryAction: null,
|
primaryAction: it.type === "app" && !it.isCore ? {
|
||||||
|
name: I18n.tr("Launch"),
|
||||||
|
icon: "open_in_new",
|
||||||
|
action: "launch"
|
||||||
|
} : null,
|
||||||
_diskCached: true,
|
_diskCached: true,
|
||||||
_hName: "",
|
_hName: "",
|
||||||
_hSub: "",
|
_hSub: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user