Summary: | Regression in kdialog causes wrong file extension | ||
---|---|---|---|
Product: | [Applications] kdialog | Reporter: | Fabian Maurer <dark.shadow4> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | akontsevich, alaves17, ashark, bugseforuns, cesarg9, chgonzalezg, david.cortes.rivera, egorov_egor, es20490446e, faure, god, kde, nate, nikonovds, rdieter, sender, simonandric5, vasyl.demin, wrar |
Priority: | NOR | Keywords: | regression |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.freedesktop.org/show_bug.cgi?id=101667 | ||
Latest Commit: | https://commits.kde.org/kio/0f8c2d7922ca130971ac3a83ed86d8e552171389 | Version Fixed In: | KDE Frameworks 5.44 |
Sentry Crash Report: | |||
Attachments: | Don't change extention for application/octet-stream |
Description
Fabian Maurer
2017-07-17 18:24:13 UTC
See also https://bugs.freedesktop.org/show_bug.cgi?id=101667 As far as I know, local changes to the shared-mime-database can be stored in .local/share/mime, so it might be possible to workaround this by using a local configuration. Thanks for the info, it seems useful to address the actual problem then. Any idea on how to do that workaround? *** Bug 383383 has been marked as a duplicate of this bug. *** Possible workaround: In filter field drop-down list is set to Unknown by default and extension is bin. But you can scroll it down and then extension will be set properly. still happening with chromium on neon dev unstable. I get correct file extensions after uncheck "automatically select file exension" below "filter" drop down. Confirm regression exists for me in openSUSE Tumbleweed: bug still exists in latest KDE when downloading file in FF or Chromium. I get .bin extension for all files instead of jpg, mp3, pdf, etc. *** This bug has been confirmed by popular vote. *** Also confirmed in Manjaro: https://forum.manjaro.org/t/chromium-to-download-files-with-the-appropriate-extension/35930 A screen-cast of the bug: https://youtu.be/jrQgPtAZk-k Another bug here: if I download and save some file to directory named ../C#/ or ../C#/../.. it renamed to C and stored in parent ../C#/ directory. @Aleksey Kontsevich, please: 1. Open a new report about that. 2. Paste its link here. Thanks ;) (In reply to Alberto Salvia Novella from comment #10) > @Aleksey Kontsevich, please: > > 1. Open a new report about that. > 2. Paste its link here. Related to Bug 388124. Any idea on a remedy here? I've gotten numerous complaints from various people, both skilled and novice, that saving files in their web browser suggests "Unknown *.bin" extension Work-around: https://forum.manjaro.org/t/chromium-to-download-files-with-the-appropriate-extension/35930 There is a workaround inside kdialog, there's no need to uninstall it. Read the 1st comment I posted some time ago at Bug #383383 Created attachment 109809 [details] Don't change extention for application/octet-stream Another cause of the bug is commit at plasma-integration: author Elvis Angelaccio <elvis.angelaccio@kde.org> 2017-05-23 10:48:24 (GMT) commit 0dafb9403266d6064074250d44b74dc0db946cfb /src/platformtheme/kdeplatformfiledialoghelper.cpp parent 708ff0d0b2905e4c68a9fb22b8a2f439d2f2fb65 (diff) 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). I suggest to do something as at KFileWidget... Don't change extention for application/octet-stream At kio package: --- a/src/filewidgets/kfilewidget.cpp +++ b/src/filewidgets/kfilewidget.cpp @@ -2245,7 +2245,8 @@ void KFileWidgetPrivate::updateAutoSelectExtension() } } - if (!currentExtension.isEmpty() && extensionList.contains(QLatin1String("*.") + currentExtension)) { + if ((!currentExtension.isEmpty() && extensionList.contains(QLatin1String("*.") + currentExtension)) + || filter == QStringLiteral("application/octet-stream")) { extension = QLatin1Char('.') + currentExtension; } else { extension = defaultExtension; Can confirm the bug is still present in debian sid with plasma 5.11.4, kde applications 17.08, and frameworks 5.42. It also affects other software. Git commit 0f8c2d7922ca130971ac3a83ed86d8e552171389 by Nathaniel Graham, on behalf of Igor Janssen. Committed on 10/02/2018 at 16:56. Pushed by ngraham into branch 'master'. Fix bug #382437 "Regression in kdialog causes wrong file extension" Summary: 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. Reviewers: #plasma, dfaure Reviewed By: dfaure Subscribers: ngraham, aacid, broulik, plasma-devel, #frameworks Tags: #frameworks, #plasma Differential Revision: https://phabricator.kde.org/D10114 M +2 -1 src/filewidgets/kfilewidget.cpp https://commits.kde.org/kio/0f8c2d7922ca130971ac3a83ed86d8e552171389 |