Just like '.desktop' files (henceforth: Desktop) '.directory' (Directory) and '.flatpakref' (Flatpak) files are also special text files and should be treated as such, which means they should not generate a content thumbnail when Text Files preview is enabled in Dolphin, like they do currently, but instead should keep showing their designated icon. This issue was affecting Desktop files as well up until very recently (November 2018), but was "mysteriously" fixed in (I presume) KDE Frameworks 5.52, as can be seen in the closing comments of https://bugs.kde.org/show_bug.cgi?id=220330 Unfortunately, as far a I can tell, the solution to this problem was not reached through manipulating e.g. the file type but by simply hard-coding the '.desktop' file extension as special. My "evidence" for that: - Directory files are the exact same file type as Desktop files (desktop configuration file) yet they do generate text thumbnails. - If a Desktop file's '.desktop' extension is changed to something else (e.g. '.deskto'), then the Desktop file behaves as a normal text file and erroneously generates a content preview. - And of course, if a Directory file's extension is changed from '.directory' to '.desktop', it properly shows its icon just as if it were a Desktop file (this won't work for Flatpak files though, since they're a separate mime type). STEPS TO REPRODUCE 1. Go to Dolphin -> Configure Dolphin -> General -> Previews and disable "Text Files". 2. Directory & Flatpak files display their icon as they should (see 1st screenshot) 3. Go to Dolphin -> Configure Dolphin -> General -> Previews and enable "Text Files". 4. Directory & Flatpak files display their text contents instead of their icons (see 2nd screenshot) 5. Desktop files are unaffected by the whole process unless their file extension is changed, as already mentioned. EXPECTED RESULT Directory files (found in e.g. ~/.local/share/desktop-directories) and Flatpak files should both be treated as special text files, just like Desktop files are, and always show their icons instead of their text contents. Additionally, all three of these files could/should be completely decoupled from the Text Files preview option and instead be included in separate preview entries: Desktop & Directory files in e.g. "Desktop Launchers", and Flatpak files in "Flatpak" (exactly like Appimage files). ADDITIONAL INFO: - The issue with Flatpak files has previously been reported in https://bugs.kde.org/show_bug.cgi?id=400201, but the bug report has gone stale.
Created attachment 121925 [details] Text Files preview disabled
Created attachment 121926 [details] Text Files preview enabled
.flatpakref issue already reported as bug 400201
Submitted a patch: https://phabricator.kde.org/D22936
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 400201 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