https://bugs.kde.org/show_bug.cgi?id=382437

Igor Janssen <alave...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alave...@gmail.com

--- Comment #15 from Igor Janssen <alave...@gmail.com> ---
Created attachment 109809
  --> https://bugs.kde.org/attachment.cgi?id=109809&action=edit
Don't change extention for application/octet-stream

Another cause of the bug is commit at plasma-integration:
author  Elvis Angelaccio <elvis.angelac...@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;

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to