Save the dialog view settings when closing the dialog without hitting the cancel button
ClosedPublic

Authored by ngraham on Apr 15 2018, 11:29 PM.

Details

Summary

Save the view settings when the user closes the dialog using the excape key or the titlebar close button. Completes the feature requested in 209559.

CCBUG: 209559

Depends on D12227

Test Plan

Compile and deploy change, open Kate, open a file open or save dialog, change some settings, hit the escape key or the titlebar cancel button, then open a dialog again

Diff Detail

Repository
R135 Integration for Qt applications in Plasma
Branch
save-view-config-on-close-and-escape (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham created this revision.Apr 15 2018, 11:29 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 15 2018, 11:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Apr 15 2018, 11:29 PM
elvisangelaccio added inline comments.
src/platformtheme/kdeplatformfiledialoghelper.cpp
244

typo: pressed

ngraham marked an inline comment as done.Apr 16 2018, 10:25 PM
anthonyfieroni added inline comments.
src/platformtheme/kdeplatformfiledialoghelper.cpp
247

You can see at line 108 on reject is called slotCancel, so for convenience just call it

m_fileWidget->slotCancel();

Then you can discard D12239

anthonyfieroni added inline comments.Apr 17 2018, 3:58 AM
src/platformtheme/kdeplatformfiledialoghelper.cpp
108–112

Even better to me should be

connect(this, &KDEPlatformFileDialog::rejected, m_fileWidget, &KFileWidget::slotCancel);

PS: You can make a different review to change old syntax (SIGNAL/SLOT) to new function pointers.

ngraham updated this revision to Diff 32361.Apr 17 2018, 4:57 AM

Use a vastly cleaner and cleverer approach (thanks @anthonyfieroni)

ngraham marked 2 inline comments as done.Apr 17 2018, 4:58 AM
ngraham added inline comments.
src/platformtheme/kdeplatformfiledialoghelper.cpp
108–112

Sounds good, I will do that after this!

ngraham marked an inline comment as done.Apr 17 2018, 5:05 AM

...Gotta make sure that cancel slot actually works, so this is now dependent on my patch that fixes it: D12227

davidedmundson accepted this revision.Apr 17 2018, 10:11 PM
This revision is now accepted and ready to land.Apr 17 2018, 10:11 PM
This revision was automatically updated to reflect the committed changes.