Bug 417355

Summary: "Filter" dropdown of file open dialog has empty entries
Product: [Frameworks and Libraries] frameworks-kio Reporter: Patrick Silva <bugseforuns>
Component: Open/save dialogsAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.67.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.68
Sentry Crash Report:
Attachments: screen recording

Description Patrick Silva 2020-02-09 19:34:32 UTC
Created attachment 125803 [details]
screen recording

SUMMARY
dragon player and gwenview are examples of affected apps on my system.
Attached screen recording shows gwenview case.

STEPS TO REPRODUCE
1. open gwenview 
2. press ctrl+o
3. open "Filter" dropdown

OBSERVED RESULT
dropdown has empty entries 

EXPECTED RESULT
no empty entry

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.17.90
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 Ahmad Samir 2020-03-07 07:40:00 UTC
Git commit 9cb7cf957a1cc2e60fae7f82caff325221e8bcf4 by Ahmad Samir.
Committed on 07/03/2020 at 07:39.
Pushed by ahmadsamir into branch 'master'.

[KFileFilterCombo] Don't add invalid QMimeType to mimes filter

Summary:
When setting the mime filter, check that the QMimeType we get from
QMimeDatabase::mimeTypeForName() is valid before adding it to the mime
filter list. This fixes a bug where if the QMimeType is invalid its name
(and comment) property is empty, leading to empty entries in the filter
widget drop-down menu.

Per dfaure's recommendation, display a warning about the invalid mimeType.

Also install the necessary Qt logging catergory bits for KFileWidgets.

FIXED-IN: 5.68

Test Plan:
- Open gwenview -> file -> open and check the filter drown-down menu
  there are a couple (two?) empty entries
- Apply diff and try again, no empty entries

Reviewers: #frameworks, dfaure, meven, sitter, broulik

Reviewed By: dfaure

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27865

M  +16   -0    src/filewidgets/CMakeLists.txt
M  +6    -1    src/filewidgets/kfilefiltercombo.cpp

https://commits.kde.org/kio/9cb7cf957a1cc2e60fae7f82caff325221e8bcf4