From af5f6eb6565ab25e554ea09c03a25ace360fa85f Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 17 Feb 2026 22:20:01 -0500 Subject: [PATCH] settings: workaround crash --- .../Modules/Settings/ThemeColorsTab.qml | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/quickshell/Modules/Settings/ThemeColorsTab.qml b/quickshell/Modules/Settings/ThemeColorsTab.qml index f4aac4c8..f2416792 100644 --- a/quickshell/Modules/Settings/ThemeColorsTab.qml +++ b/quickshell/Modules/Settings/ThemeColorsTab.qml @@ -16,7 +16,7 @@ Item { property var cachedCursorThemes: SettingsData.availableCursorThemes property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label) property var installedRegistryThemes: [] - property var templateDetection: ({}) + property var templateDetection: [] property var cursorIncludeStatus: ({ "exists": false, @@ -106,9 +106,10 @@ Item { } function isTemplateDetected(templateId) { - if (!templateDetection || Object.keys(templateDetection).length === 0) + if (!templateDetection || templateDetection.length === 0) return true; - return templateDetection[templateId] !== false; + var item = templateDetection.find(i => i.id === templateId); + return !item || item.detected !== false; } function getTemplateDescription(templateId, baseDescription) { @@ -145,30 +146,17 @@ Item { DMSService.listInstalledThemes(); if (PopoutService.pendingThemeInstall) Qt.callLater(() => showThemeBrowser()); - templateCheckProcess.running = true; + Proc.runCommand("template-check", ["dms", "matugen", "check"], (output, exitCode) => { + if (exitCode !== 0) + return; + try { + themeColorsTab.templateDetection = JSON.parse(output.trim()); + } catch (e) {} + }); if (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl) checkCursorIncludeStatus(); } - Process { - id: templateCheckProcess - command: ["dms", "matugen", "check"] - running: false - - stdout: StdioCollector { - onStreamFinished: { - try { - const results = JSON.parse(text); - const detection = {}; - for (const item of results) { - detection[item.id] = item.detected; - } - themeColorsTab.templateDetection = detection; - } catch (e) {} - } - } - } - Connections { target: DMSService function onInstalledThemesReceived(themes) {