Bug 417355 - "Filter" dropdown of file open dialog has empty entries
Summary: "Filter" dropdown of file open dialog has empty entries
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 5.67.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-09 19:34 UTC by Patrick Silva
Modified: 2020-03-07 07:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.68
Sentry Crash Report:


Attachments
screen recording (3.08 MB, video/webm)
2020-02-09 19:34 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
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