I agree that's a bit weird, and thought of taking it out, but strictly
speaking the "pinToggled" signal tells that the pin was toggled. If an
external entity (the BookmarksModel, for example) disagrees, it may
adjust the pin state.
Now, about using the onPinChanged signal.
This is the code that listens to the pin toggling:
OverlayBar {
onPinToggled: BookmarkModel.togglePin(visibleTab.url);
Connections {
target: BookmarkModel
onCountChanged: {
if (visibleTab)
overlayBar.pin = BookmarkModel.contains(visibleTab.url);
}
}
}
The UI is pinned/unpinned, the change is propagated to the model, and
when the model changes (if everything works fine there) the changed is
confirmed in the UI.
Using onPinChanged would result in an infinite loop, and an scheme to
go around that would be as complicated as using onPinToggled.
--
Marcelo Lira dos Santos
INdT - Instituto Nokia de Tecnologia