Fix bug #382437 "Regression in kdialog causes wrong file extension"
ClosedPublic

Authored by ijanssen on Jan 26 2018, 2:19 PM.

Details

Summary

BUG: 382437
One cause of the bug is commit at plasma-integration:
0dafb9403266d6064074250d44b74dc0db946cfb
Make sure we always set a default mime filter in save mode
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.

Chrome opens kdialog with 2 mime types: application/octet-stream (means any file) and (for example) image/jpeg. But application/octet-stream is associated with *.bin extension. When you choose this mime extention becomes *.bin. That commit does this mime default (it's first).
This patch blocks changing extention to bin for "application/octet-stream" selected.

Test Plan

Tested with Google Chrome. Used Open/Save dialogs for files.

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
ijanssen created this revision.Jan 26 2018, 2:19 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 26 2018, 2:19 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
ijanssen requested review of this revision.Jan 26 2018, 2:19 PM
ijanssen edited the summary of this revision. (Show Details)Jan 26 2018, 2:21 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 26 2018, 2:26 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Yes, please!

I agree that shared-mime-info must be fixed to remove the .bin extension but this will take forever and this is a serious regression preventing any novice user from downloading files properly.

aacid added a subscriber: aacid.Jan 26 2018, 11:44 PM

autotest possible?

ngraham edited the summary of this revision. (Show Details)Jan 27 2018, 12:22 AM
ngraham added a subscriber: ngraham.
dfaure accepted this revision.Jan 28 2018, 9:57 AM

Indeed.

Fixed in shared-mime-info 1.10 (commit 009f22a, https://bugs.freedesktop.org/show_bug.cgi?id=101667)

Fix proposed for Qt: https://codereview.qt-project.org/218155

This revision is now accepted and ready to land.Jan 28 2018, 9:57 AM

Is this committable?

Is this committable?

I think yes

It doesn't merge cleanly on master. Can you re-base it?

ijanssen updated this revision to Diff 26877.Feb 10 2018, 4:12 PM

It doesn't merge cleanly on master. Can you re-base it?

I've updated diff.

Thanks. Confirmed the fix, BTW.

To commit this for you, I need an email address. Can you provide one?

To commit this for you, I need an email address. Can you provide one?

alaves17@gmail.com

ngraham closed this revision.Feb 10 2018, 5:04 PM