import QtQuick Item { property int activations: 0 property int actionActivations: 0 property var rows: [ { "id": "terminal", "title": "fixture terminal", "subtitle": "terminal app", "genericName": "terminal", "desktopId": "fixture-terminal.desktop", "glyph": "", "actions": [ { "id": "new", "title": "new terminal" } ], "details": [ { "label": "category", "value": "fixture" } ] }, { "id": "editor", "title": "fixture editor", "subtitle": "editor app", "genericName": "editor", "desktopId": "fixture-editor.desktop", "glyph": "", "actions": [], "details": [] } ] function search(query) { const lastQuery = String(query || ""); const needle = lastQuery.toLowerCase(); const results = rows.filter(row => needle.length === 0 || String(row.title).toLowerCase().indexOf(needle) >= 0); return JSON.stringify({ "query": lastQuery, "providerIntent": "app", "selectedIndex": results.length > 0 ? 0 : -1, "results": results }); } function activate(rowJson) { activations++; return stateJson(); } function activateAction(rowJson, index) { actionActivations++; return stateJson(); } function stateJson() { return JSON.stringify({ "activations": activations, "actionActivations": actionActivations }); } }