Save the dialog view settings even when canceling
Currently, for file Open & Save dialogs, any view settings you've changed are only remembered if you actually open or save the file; they're ignored if you cancel the dialog using the Cancel button. there's no particular reason why a user should want to discard any view changes just because they decided not to open or save the file, so we should fix that.
This patch fixes a bug causing the issue: the attempt to write the changed view config settings was issued after the KDirOperator had already been destroyed, so its settings were unavailable to be saved. Reversing the ordering of the statements fixes the issue.
Open a file open or save dialog, change the view, hit the cancel button, then open it again.
Note: this patch does not fix the case of the view not being saved when closing the dialog via the Escape key or the titlebar close button; those cases need to be separately handled in the QPA theme plugin, which actually creates the dialog window; see D12239 and D12240.
Reviewers: Frameworks, davidedmundson
Reviewed By: davidedmundson
Differential Revision: https://phabricator.kde.org/D12227