Bug 400201 - Text previewer deals with flatpakref file as text file
Summary: Text previewer deals with flatpakref file as text file
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Thumbnails and previews (show other bugs)
Version: 18.12.3
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2018-10-23 13:59 UTC by Patrick Silva
Modified: 2019-08-08 14:00 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.08.0


Attachments
screenshot (112.35 KB, image/png)
2018-10-23 13:59 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2018-10-23 13:59:40 UTC
Created attachment 115851 [details]
screenshot

STEPS TO REPRODUCE
1. open dolphin settings, click "Previews" tab in "General" section
2. check "Text files" previewer, click "ok" button
3. open some folder containing a flatpakref file

OBSERVED RESULT
flatpakref fle appears as text preview. See the screenshot.


EXPECTED RESULT
Dolphin should only show the file icon

SOFTWARE VERSIONS
Arch Linux
KDE Plasma Version: 5.14.1
KDE Frameworks Version: 5.51
Qt Version: 5.12 beta2
Comment 1 Elvis Angelaccio 2018-10-24 15:25:36 UTC
Why? A flatpakref file is a text file (according to its mimetype definition in shared-mime-info).
Comment 2 Kai Uwe Broulik 2018-10-25 08:34:02 UTC
It technically is but from a user's POV it's not.
We explicitly ignore .desktop files (that are also technically text files) for that reason, perhaps we can do the same here. I'm not a fan of adding a blacklist of random mime types to the previewer, though :/
Comment 3 Nate Graham 2019-08-04 23:42:58 UTC
Submitted a patch: https://phabricator.kde.org/D22936
Comment 4 Nate Graham 2019-08-08 14:00:49 UTC
Git commit df85d47c7242aeb7b713de48049891628254a67d by Nate Graham.
Committed on 08/08/2019 at 14:00.
Pushed by ngraham into branch 'Applications/19.08'.

[Text thumbnailer] Don't show text preview for .directory and .flatpakref files

Summary:
The text thumbnailer currently excludes .directory files from receiving text file
thumbnails, but does not do the same for .directory and .flatpakref files which are
the same things (actually text files that don't look, feel, or behave like text files).

This patch extends the same logic to those types of files as well, making them not
receive text previews and instead show their base mimetype or icon (if defined in the
file).
Related: bug 410561
FIXED-IN: 19.08.0

Test Plan: {F7161776, size=full}

Reviewers: #vdg, #frameworks, broulik

Reviewed By: broulik

Subscribers: kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

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

M  +6    -2    thumbnail/textcreator.cpp

https://commits.kde.org/kio-extras/df85d47c7242aeb7b713de48049891628254a67d