small code cleanup and added components/ folder for reusable code

This commit is contained in:
SomeElse
2026-05-16 07:05:35 +00:00
parent d1f892f3a0
commit 526607ee8d
8 changed files with 78 additions and 96 deletions

View File

@@ -31,6 +31,7 @@ PanelWindow {
property bool _keyboardNav: false
property var allItems: []
property bool loading: false
property int lastCacheUpdate: 0
readonly property int defaultIndex: Cfg.Config.launcherSelectFirst ? 0 : -1
@@ -67,7 +68,14 @@ PanelWindow {
function loadItems() {
loading = true
var now = Date.now()
var staleMs = 300000
if (now - lastCacheUpdate < staleMs) {
readCache()
return
}
readCache()
lastCacheUpdate = now
updateProc.command = [Cfg.Config.launcherScript, "--update-only"]
updateProc.running = true
}