[Folder View] Don't break FolderView url binding to configured URL when going home
ClosedPublic

Authored by broulik on Mar 28 2017, 3:25 PM.

Details

Summary

Otherwise after navigating to subfolders in the popup, changing the URL in configuration isn't immediately applied.

Test Plan

Had FolderView in panel, opened subfolder from the popup, closed popup, it reverted back to home.
Now I changed the URL in its settings. Before it would not update it until I opened and closed the popup, with this patch it immediately updates.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 28 2017, 3:25 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 28 2017, 3:25 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein accepted this revision.Mar 28 2017, 3:56 PM

So binding to a function returning that prop means when the config prop notifies the function is rerun and the value updated, right? Sounds good.

This revision is now accepted and ready to land.Mar 28 2017, 3:56 PM

So binding to a function returning that prop means when the config prop notifies the function is rerun and the value updated, right?

Yes, it behaves as if I had written url: foo in the markup. When using JavaScript, explicitly assigning a value breaks the binding and the value is fixed to the value at the time of assignment. Qt.binding(…) imperatively establishes a binding, when you access the property you get the value back as normal but it updates when its dependants change like any other property

See https://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html#creating-property-bindings-from-javascript

This revision was automatically updated to reflect the committed changes.
hein added a comment.Mar 28 2017, 4:09 PM

:) Right, "imperative way to assign a binding" sums it up.