Fix duplicate onBarWidgetRegistryChanged in bar-settings panel
Two handlers were declared for the same property-change signal — QML refuses to load the file with 'Property value set multiple times', so summoning omarchy.bar-settings failed silently. Merged the debug log into the existing catalogRevision++ handler.
This commit is contained in:
@@ -287,8 +287,18 @@ Item {
|
|||||||
property int catalogRevision: 0
|
property int catalogRevision: 0
|
||||||
// Bump on every registry assignment (including the initial null → instance
|
// Bump on every registry assignment (including the initial null → instance
|
||||||
// injection from Loader.onLoaded) so bindings that derive from
|
// injection from Loader.onLoaded) so bindings that derive from
|
||||||
// widgetMetadata pick up the new state.
|
// widgetMetadata pick up the new state. The host injects the registry
|
||||||
onBarWidgetRegistryChanged: catalogRevision++
|
// asynchronously via the Loader, so we also log once it lands.
|
||||||
|
onBarWidgetRegistryChanged: {
|
||||||
|
catalogRevision++
|
||||||
|
if (!root.barWidgetRegistry) return
|
||||||
|
console.log("bar-settings open. omarchyPath=" + root.omarchyPath,
|
||||||
|
"defaultsPath=" + root.defaultsPath,
|
||||||
|
"userConfigPath=" + root.userConfigPath,
|
||||||
|
"registry has",
|
||||||
|
root.barWidgetRegistry.availableIds().length,
|
||||||
|
"widgets")
|
||||||
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: root.barWidgetRegistry
|
target: root.barWidgetRegistry
|
||||||
function onChanged() {
|
function onChanged() {
|
||||||
@@ -421,19 +431,6 @@ Item {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only log once the registry has actually been injected by the host. The
|
|
||||||
// raw Component.onCompleted fires before the Loader's onLoaded property
|
|
||||||
// injection so it would always print `(null)` widgets, which is noise.
|
|
||||||
onBarWidgetRegistryChanged: {
|
|
||||||
if (!root.barWidgetRegistry) return
|
|
||||||
console.log("bar-settings open. omarchyPath=" + root.omarchyPath,
|
|
||||||
"defaultsPath=" + root.defaultsPath,
|
|
||||||
"userConfigPath=" + root.userConfigPath,
|
|
||||||
"registry has",
|
|
||||||
root.barWidgetRegistry.availableIds().length,
|
|
||||||
"widgets")
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: defaultsFile
|
id: defaultsFile
|
||||||
path: root.defaultsPath
|
path: root.defaultsPath
|
||||||
|
|||||||
Reference in New Issue
Block a user