1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

plugins: fix persistence of some settings

This commit is contained in:
bbedward
2025-11-08 08:27:57 -05:00
parent 9314de4772
commit 989f196894
3 changed files with 12 additions and 5 deletions

View File

@@ -803,10 +803,12 @@ rm -rf '${home}'/.cache/icon-cache '${home}'/.cache/thumbnails 2>/dev/null || tr
}
function setPluginSetting(pluginId, key, value) {
if (!pluginSettings[pluginId]) {
pluginSettings[pluginId] = {}
const updated = JSON.parse(JSON.stringify(pluginSettings))
if (!updated[pluginId]) {
updated[pluginId] = {}
}
pluginSettings[pluginId][key] = value
updated[pluginId][key] = value
pluginSettings = updated
savePluginSettings()
}
@@ -818,7 +820,8 @@ rm -rf '${home}'/.cache/icon-cache '${home}'/.cache/thumbnails 2>/dev/null || tr
}
function getPluginSettingsForPlugin(pluginId) {
return pluginSettings[pluginId] || {}
const settings = pluginSettings[pluginId]
return settings ? JSON.parse(JSON.stringify(settings)) : {}
}

View File

@@ -27,6 +27,10 @@ Column {
}
}
Component.onCompleted: {
Qt.callLater(loadValue)
}
onValueChanged: {
if (!isInitialized) return
const settings = findSettings()

View File

@@ -26,7 +26,7 @@ Row {
}
Component.onCompleted: {
loadValue()
Qt.callLater(loadValue)
}
onValueChanged: {