mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
settings: workaround crash
This commit is contained in:
@@ -16,7 +16,7 @@ Item {
|
|||||||
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
||||||
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
||||||
property var installedRegistryThemes: []
|
property var installedRegistryThemes: []
|
||||||
property var templateDetection: ({})
|
property var templateDetection: []
|
||||||
|
|
||||||
property var cursorIncludeStatus: ({
|
property var cursorIncludeStatus: ({
|
||||||
"exists": false,
|
"exists": false,
|
||||||
@@ -106,9 +106,10 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isTemplateDetected(templateId) {
|
function isTemplateDetected(templateId) {
|
||||||
if (!templateDetection || Object.keys(templateDetection).length === 0)
|
if (!templateDetection || templateDetection.length === 0)
|
||||||
return true;
|
return true;
|
||||||
return templateDetection[templateId] !== false;
|
var item = templateDetection.find(i => i.id === templateId);
|
||||||
|
return !item || item.detected !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTemplateDescription(templateId, baseDescription) {
|
function getTemplateDescription(templateId, baseDescription) {
|
||||||
@@ -145,30 +146,17 @@ Item {
|
|||||||
DMSService.listInstalledThemes();
|
DMSService.listInstalledThemes();
|
||||||
if (PopoutService.pendingThemeInstall)
|
if (PopoutService.pendingThemeInstall)
|
||||||
Qt.callLater(() => showThemeBrowser());
|
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)
|
if (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl)
|
||||||
checkCursorIncludeStatus();
|
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 {
|
Connections {
|
||||||
target: DMSService
|
target: DMSService
|
||||||
function onInstalledThemesReceived(themes) {
|
function onInstalledThemesReceived(themes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user