Bug 220330 - If "Text File" previews are enabled and previews are turned on, .desktop files show a thumbnail of their textual contents rather than the icon specified in the file
Summary: If "Text File" previews are enabled and previews are turned on, .desktop file...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.51.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: usability
: 211729 261410 380873 392908 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-28 00:41 UTC by Nicofo
Modified: 2018-11-28 21:29 UTC (History)
16 users (show)

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


Attachments
Desktop file - wrong preview (63.90 KB, image/png)
2018-11-10 10:59 UTC, Nicofo
Details
Works for me (17.02 KB, image/png)
2018-11-10 14:58 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicofo 2009-12-28 00:41:41 UTC
Version:            (using KDE 4.3.3)
Installed from:    Fedora RPMs

With dolphin, open a folder with desktop files (associated with applications so that an icon is defined): e.g. open the folder   /usr/share/applications

1) if you don't use the "preview mode" (button preview in the main toolbar) => the icon of the the desktop files is displayed (ex: the icon of firefox is shown with the mozilla-firefox.desktop file)

2) but if you use the "preview mode" => no icon is shown (instead a preview of a text file is shown)

Remark 1) the zoom has no influence with this nor have the "Details" or "Icons" buttons (main toolbar)
Remark 2) the settings in Configure Dolphin > General > Previews > Desktop Files doesn't change anything
Comment 1 Frank Reininghaus 2009-12-28 12:20:28 UTC
Thanks for the bug report! I cannot reproduce this.

> Remark 2) the settings in Configure Dolphin > General > Previews > Desktop
> Files doesn't change anything

This should actually work...
Comment 2 Nicofo 2009-12-28 17:30:45 UTC
Additional remark: if you refresh the view (<F5>), the icon is displayed during a fraction of second.

> This should actually work...

OK, so I have played with the preview settings (Configure Dolphin > General > Previews) and here is what I have just seen:
- with "Text Files" checked: check or uncheck "Desktop Files" doesn't change anything: the icon is never shown.
- with "Text Files" unchecked: check or uncheck "Desktop Files" has the reverse effect !!! if UNchecked => the icon is shown, if checked, there is a preview of
a text file "[Desktop Entry]..."

==> it seems there is a conflict between the preview options "Text Files" and "Desktop Files"...
Comment 3 Frank Reininghaus 2009-12-29 00:05:42 UTC
Thanks for the update! I could reproduce the problem now by enabling previews for "Text Files".

> ==> it seems there is a conflict between the preview options "Text Files" and
> "Desktop Files"...

Yes, it seems so.
Comment 4 Nicofo 2010-02-24 23:14:58 UTC
Hello,

The bug is still present in KDE 4.4.
Comment 5 Nicofo 2010-06-18 19:26:52 UTC
(still present in kde 4.4.4)

Remark: You can see an effect of the bug in the "Network" page of dolphin (type "remote:/" in the address bar). The "Add Network Folder" icon is replaced by a text preview...  Not nice...


I think the best way to resolve this is:

- if the preview options "Text Files" and "Desktop Files" are both enabled,
- the preview options "Text Files" must be ignored for .desktop files.
(previewing desktop files in "text" in not relevant !)

Easy isn't it ? What do you think of this ?
Comment 6 Todd 2010-08-21 19:16:29 UTC
This is still present for 4.5 for me.
Comment 7 Frank Reininghaus 2010-12-27 22:22:07 UTC
*** Bug 261410 has been marked as a duplicate of this bug. ***
Comment 8 Todd 2011-01-18 08:50:33 UTC
Still present for 4.6 RC 1.
Comment 9 Nicofo 2011-03-07 20:02:46 UTC
(In reply to comment #8)
> Still present for 4.6 RC 1.

and in 4.6.1 too...
Comment 10 Todd 2011-07-31 07:41:46 UTC
Still present in KDE 4.7.
Comment 11 Nicofo 2012-01-28 18:03:43 UTC
Still present in KDE 4.8, despite the fact that dolphin has been partially rewritten.

Just go to /usr/share/applications/ for instance: there is no preview of the application files (desktop files) if text preview is enabled.
Comment 12 Peter Penz 2012-01-28 19:10:13 UTC
Sadly the root cause of this issue is outside the scope of Dolphin and is unrelated to the view-engine. I currently don't have enough time to take care for fixing this in kdelibs... :-( Hopefully somebody else can check this (I'm not sure whether a clean fix is trivial, I guess currently there is no mechanism regarding conflicting preview-plugins). I'd still suggest to leave the bug assigned to Dolphin...
Comment 13 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:18:29 UTC
Resetting assignee to default as per bug #305719
Comment 14 Maarten De Meyer 2013-05-07 22:31:00 UTC
I have not found an easy fix for this.
Thex x-desktop file icons are not created with a kde_thumbnailer but inside kfileitem.cpp
If it was moved into a ThumbCreator we could give the desktop file one a higher ThumbnailerVersion.
Don't think you can exclude mimetypes from the textthumbnail.desktop, that would also make this an easy fix :)

I'm not even sure if this is a good idea, some people might want the text thumbnail for desktop files.
-Preview disabled: desktop file icons
-Preview enabled:  text thumbnails
Comment 15 Maarten De Meyer 2013-05-07 23:31:12 UTC
*** Bug 211729 has been marked as a duplicate of this bug. ***
Comment 16 Frank Reininghaus 2013-05-08 07:38:19 UTC
@Maarten: Thanks for the analysis. I wonder why you marked the KIO bug as a duplicate of the Dolphin one. Are you suggesting that we can do something about this in Dolphin?
Comment 17 Maarten De Meyer 2013-05-08 09:30:03 UTC
No you are correct, this is not a dolphin problem. I'm not sure what the correct way to fix this is, so I forgot to set the right component.
I changed it to kio thumbails for now.
Comment 18 Maarten De Meyer 2013-05-08 15:35:22 UTC
A possible solution might be creating a (new) small thumbailer for x-desktop files.
If it has ThumbnailerVersion=2 it should overrule the textthumbnails.
The preview would just be a bigger version of the icon.

Do you agree with this solution Frank? It is a bit of a workaround and I don't think it should be pushed upstream.

Making a thumbnailer is rather easy, look for an example online. I'm not going to write it though, I don't use textthumbnails.
Comment 19 Frank Reininghaus 2013-05-10 08:09:56 UTC
(In reply to comment #18)
> Do you agree with this solution Frank? 

Unfortunately, I can't say much about this issue because I'm not familiar with the preview-generation code that lives outside Dolphin.
Comment 20 DE LEO Francesco 2013-05-22 09:13:10 UTC
Kde 4.10.3: this bug is still present.
Comment 21 michaelaquilina@gmail.com 2014-02-24 09:13:41 UTC
Has this bug been fixed? It no longer seems to be an issue for me (Dolphin 4.11.5)
Comment 22 S. Bryant 2014-02-24 12:38:09 UTC
I'm still seeing this bug (Dolphin 4.12.2).
Previews for *.desktop files are still affected by the setting for text files.
Comment 23 michaelaquilina@gmail.com 2014-02-24 13:26:50 UTC
Actually ignore my previous comment, the text preview option had been disabled for some reason.
Comment 24 Christoph Feck 2017-06-20 02:38:38 UTC
*** Bug 380873 has been marked as a duplicate of this bug. ***
Comment 25 Bernie Innocenti 2017-06-20 15:11:27 UTC
Still present in Plasma 5.10.2.
Comment 26 Christoph Feck 2018-04-09 11:14:32 UTC
*** Bug 392908 has been marked as a duplicate of this bug. ***
Comment 27 Kai Uwe Broulik 2018-06-06 07:24:31 UTC
Git commit 9b27cf15433f7339341bc226dae9804755bc61a1 by Kai Uwe Broulik.
Committed on 06/06/2018 at 07:23.
Pushed by broulik into branch 'master'.

Don't generate thumbnail for desktop files

Desktop files aren't traditional text files

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

M  +7    -0    thumbnail/textcreator.cpp

https://commits.kde.org/kio-extras/9b27cf15433f7339341bc226dae9804755bc61a1
Comment 28 Nicofo 2018-11-10 10:59:13 UTC
Created attachment 116228 [details]
Desktop file - wrong preview

Sorry, this is not fixed for me: exactly same behaviour as before. See screenshot.

(reminder: in Dolphin settings, I have enabled the preview of Text files)
Comment 29 Nicofo 2018-11-10 11:01:02 UTC
KDE Framework 5.51
Qt 5.11.1
Dolphin 18.08.1
Fedora 29
Comment 30 Nate Graham 2018-11-10 14:58:25 UTC
Created attachment 116238 [details]
Works for me

Huh, it works for me with Frameworks 5.51 and Dolphin 18.08.3. See attachment.
Comment 31 Nicofo 2018-11-10 17:15:54 UTC
OK, I saw also that it worked there: https://phabricator.kde.org/D13332

I suppose that in Dolphin settings, you have well enabled the preview of Text files ?

What could be the difference between your installation (working) and mine (not working) ?
Comment 32 Nate Graham 2018-11-14 19:16:18 UTC
Does it work with .desktop files for apps that you view in Dolphin? Does it work in a new user account?
Comment 33 Nicofo 2018-11-15 21:19:51 UTC
(In reply to Nate Graham from comment #32)
> Does it work with .desktop files for apps that you view in Dolphin?
(not sure to understand what you say ?) None of the desktop files are correctly displayed (see an example in the screenshot of my comment #28)

> Does it work in a new user account?
I have tested with a new user account -> same result, bug present. I just noticed that, by default in dolphin settings, the preview of everything is enabled, except the preview of Text files (strange ! Why ?). So by default this bug is not visible. It occurs only after changing that setting.
Comment 34 Nate Graham 2018-11-26 05:25:20 UTC
(In reply to Nicofo from comment #33)
> > Does it work in a new user account?
> I have tested with a new user account -> same result, bug present. I just
> noticed that, by default in dolphin settings, the preview of everything is
> enabled, except the preview of Text files (strange ! Why ?). So by default
> this bug is not visible. It occurs only after changing that setting.
I cannot reproduce the issue with a new user account on Neon dev unstable with everything from git master. Here are my steps to (not) reproduce:
1. Create a new user account
2. Log into that user account
3. Open Dolphin
4. Click on Network in the Places panel

"Add Network Folder" has an icon preview rather than showing up as a text file.

Can you describe in detail what is necessary after step 4 to get the bug to happen?
Comment 35 Nicofo 2018-11-28 21:26:19 UTC
(In reply to Nate Graham from comment #34)
> 1. Create a new user account
> 2. Log into that user account
> 3. Open Dolphin
> 4. Click on Network in the Places panel
> 
> Can you describe in detail what is necessary after step 4 to get the bug to
> happen?

5. In Dolphin, go to Control > Configure Dolphin. In General tab, go to Previews. There, select 'Text Files', the only option that was not enabled by default.

A a result, "Add Network Folder" *had* no more an icon preview.

I say "had" because the bug was still present during my last message (2018-11-15) but it seems solved now. Very strange !
But some packages have been update in between. I have now:

KDE Framework 5.52 (instead of 5.51 in comment #29)
Qt 5.11.1
Dolphin 18.08.1
Fedora 29

Probably this was fixed with Framework 5.52 ?

So let's say this is solved. Thanks for your help.
Comment 36 Nate Graham 2018-11-28 21:29:25 UTC
Heh, thank goodness! I thought I was going crazy.