Make sure we always set a default mime filter in save mode

Authored by elvisangelaccio on May 24 2017, 9:24 AM.



KFileWidget::setMimeFilter() documentation says a default mime filter
should be set if the dialog is being open in save mode.

Without a default filter, the dialog uses a custom item (created by
concatenating all the mime type filters) as default. This is not useful
because it means an additional click for the user to select a filter that can
actually be useful.

If the initiallySelectedMimeTypeFilter() is empty, we use the first mime
filter as fallback.

Test Plan

tests/qfiledialogtest --mimeTypeFilter application/json --mimeTypeFilter application/zip --acceptMode save

New unit test passes.

Diff Detail

R135 Integration for Qt applications in Plasma
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 24 2017, 9:24 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
dfaure accepted this revision.May 25 2017, 5:45 PM
This revision is now accepted and ready to land.May 25 2017, 5:45 PM
This revision was automatically updated to reflect the committed changes.