Bug 364884 - Dolphin displays ISO (disk image) file among results for "Search for: Images" pane
Summary: Dolphin displays ISO (disk image) file among results for "Search for: Images"...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: search (show other bugs)
Version: 17.04.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 02:05 UTC by KDE Neon user
Modified: 2017-09-23 13:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KDE Neon user 2016-06-29 02:05:11 UTC
Version 16.04.1

Using:
KDE Frameworks 5.23.0
Qt 5.6.0 (built against 5.6.0)
The xcb windowing system

Reproducible: Always

Steps to Reproduce:
1. Save an .ISO file in your downloads folder
2. Click on the "Search For: Images" on Dolphin
3. See the .ISO file among the results

Actual Results:  
.ISO file is included among pictures.

Expected Results:  
Only literal images (pictures) should be displayed, not disk images.
Comment 1 Nate Graham 2017-09-03 02:48:57 UTC
Heh, whoops.
Comment 2 Nate Graham 2017-09-23 04:40:45 UTC
Did some investigation. This is because baloo reports the type for ISOs as "raw CD image", and elsewhere when determining types, baloo is hardcoded to treat anything with the string "image" in it as an image. Here's a patch that fixes it: https://phabricator.kde.org/D7948
Comment 3 Nate Graham 2017-09-23 13:58:57 UTC
Git commit db30f89f1c88fd3cf52e9df95c8411be69275a71 by Nathaniel Graham.
Committed on 23/09/2017 at 13:58.
Pushed by ngraham into branch 'master'.

Only match real MIME types, not e.g. "raw CD image"

Summary:

Only match real MIME types when doing string matching to prevent pulling in unrelated files whose types match the string.

This prevents weird situations such as ISO files (which show up as "raw CD image") appearing in image searches.

Test Plan:
- Confirmed at www.mime-type.net/ that all audio, video, and image MIME types have the key word before the slash (e.g. "image/")
- Booted a clean KDE Neon VM and added an ISO and a bunch of pictures of various types
- Confirmed the problem: `baloosearch -t image iso` shows ISO files
- Patched and rebuilt Baloo
- Forced a re-index operation (balooctl disable; rm ~/.local/share/baloo/index*; balooctl enable)
- Did a new image search (`baloosearch -t image iso`) and confirmed that the ISO does not show up
- Confirmed that other images still show up

Reviewers: #frameworks, nicolasfella, dfaure, kossebau, vhanda

Reviewed By: dfaure

Subscribers: #frameworks

Tags: #frameworks

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

M  +5    -5    src/file/basicindexingjob.cpp

https://commits.kde.org/baloo/db30f89f1c88fd3cf52e9df95c8411be69275a71