Bug 290666

Summary: When folderview is configured to display a directory mounted over the network, the default gear icons are used instead of the icons specified in the .desktop files in that directory
Product: plasma4 Reporter: Gerhard <gstengel>
Component: widget-folderviewAssignee: Ignat Semenov <i.semenov.kde>
Status: RESOLVED FIXED    
Severity: normal CC: adaptee, aplanas, cfeck, debian, faure, gustavo, heretic_q2, jg.kde, klaus, krienke, peters-kdebugs, plasma-bugs, rdieter, rue
Priority: NOR    
Version: 4.7.4   
Target Milestone: ---   
Platform: openSUSE RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2
Bug Depends on: 178678    
Bug Blocks:    
Attachments: cog wheels in the folder view plasmoid
cog wheels also in Dolphin
fixed debian package for Ubuntu 12.04 i686 and x64

Description Gerhard 2012-01-05 08:22:12 UTC
Created attachment 67476 [details]
cog wheels in the folder view plasmoid

Version:           unspecified (using KDE 4.7.4) 
OS:                Linux

My /home directory is monted via NFS. After the upgrade to KDE 4.7.4 all *.desktop icons are only shown as cog wheels in dolphin and and the folder view plasmoid. (see screenshots)

Reproducible: Always

Steps to Reproduce:
1. Mount a folder with NFS
2. put a *.desktop file into it
3. open the folder with dolphin

Actual Results:  
the icon preview is a cog wheel

Expected Results:  
Dolphin should show the icon that is referred to in the desktop file

This problem started with KDE 4.7.4, was OK before with KDE 4.7.3 and all previous KDE4 versions. So I suppose it can be isolated quite well.

The interesting thing is that if you move a problematic .desktop file to a local folder, you can see the correct icon. That proofs that dolphin is basically correctly set up to show icon previews.
Somehow the problem is the NFS mount.
My NFS mount options is just "defaults", nothing special.
Comment 1 Gerhard 2012-01-05 08:23:05 UTC
Created attachment 67477 [details]
cog wheels also in Dolphin
Comment 2 Gerhard 2012-03-15 06:52:47 UTC
still present in KDE 4.8.1 :-(
Comment 3 Klaus Vink Slott 2012-04-10 05:43:33 UTC
(In reply to comment #2)
> still present in KDE 4.8.1 :-(

Yep. After update to 4.8 I see the same problem. I also have home drives on NFS (with kerberos)
Comment 4 Gerhard 2012-05-07 06:48:26 UTC
still present in KDE 4.8.3...
Comment 5 Heretic 2012-05-14 13:49:12 UTC
still present in KD 4.8.2, KDE 4.8.3.
Kubuntu 12.04.

If *.desktop file in local file system and make symlink in NFS, icon is present.

plasma-desktop errors in .xsession-errors file.

plasma-desktop(22169) KDesktopFile::isAuthorizedDesktopFile: Access to ' "/home/user/desktop/printer_u_def.desktop" ' denied, not owned by root, executable flag not set.
Comment 6 Rex Dieter 2012-05-14 13:56:23 UTC
OK, the warning is fairly clear what's going on.  Any .desktop files not in their usual places or not owned by root, are required to have executable permissions (it's a security feature)
Comment 7 Rex Dieter 2012-05-14 13:59:38 UTC
See also,
http://www.purinchu.net/wp/2009/02/21/desktop-file-security/
Comment 8 Heretic 2012-05-14 14:17:16 UTC
$ stat ./printer_u_def.desktop 
  File: `./printer_u_def.desktop'
  Size: 432             Blocks: 8          IO Block: 1048576 regular file
Device: 18h/24d Inode: 29890629    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/user)   Gid: ( 1000/user)
Access: 2012-05-14 18:15:46.161430465 +0400
Modify: 2012-05-14 18:15:46.162365397 +0400
Change: 2012-05-14 18:15:46.162365397 +0400
 Birth: -
Comment 9 Heretic 2012-05-14 14:21:41 UTC
The program is started, but the icon is not displayed
Comment 10 Rex Dieter 2012-05-14 15:39:37 UTC
I can confirm the issue as originally reported.

Using fedora 17 with kde-4.8.3 as client, and a rhel-5 nfs server,
cp /usr/share/applications/kde4/Kontact.desktop /nfs/share/
dolphin /nfs/share/

Kontact.desktop file appears as generic cog, without application icon.
Comment 11 Ignat Semenov 2012-05-14 20:03:38 UTC
OK, I think it's time to comment on this.

According to David Faure, this is by design. He introduced an isSlow()
method a couple major KDE releases ago to avoid certain slow
operations when working with network directories, to fix a certain
bug. Also, the same method was used in KDirModel, to avoid parsing
desktop files over the network. So this bug will most probably not be
fixed.
Comment 12 Gerhard 2012-05-15 19:34:35 UTC
Thanks for having shed some light on this problem finally. I think it was introduced between version 4.7.3 and 4.7.4.
I'm not very happy with your conclusion that this bug won't be fixed, though. I suppose almost everyone using KDE in a more professional environment will have /home mounted by NFS. I can't really believe that the KDE developers are satisfied with seeing a lot of cog wheels on their desktops. That really breaks the otherwise very nice looks of KDE for me.
Comment 13 Klaus Vink Slott 2012-05-15 20:08:47 UTC
Like Gerhard I am disapointed. And I think the reasons for not fixing is a bit thin:
a: how can changing the look of an icon be a safety feature - the program still runs
b: I am connected to my file server with a gigabit network. The servers disks is the bottleneck. NFS does not add much to that. 

To me it looks like the developer has just simply forgotten that in NFS environment root cant access user files.

Oh well. Compared to all the other bugs in KDE, this is a minor one. Life is to short for plasma using 80% cpu after a couple of hours, kmail2 throwing weird IMAP errors... sigh.
Comment 14 Petrer 2012-09-17 14:12:44 UTC
I agree with Klaus Vink Slott (c13) that I don't see the reason to not fix this bug. Declaring NFS=SLOW is a bug in it self and dropping icons with the excuse that it will add 0.001 sec to desktop display doesn't make sense. If speed is so important over look then drop 3D functions and other things that cause a time delay that I can at least see.
Also, why not make it an option ? right now the only way to see something else then a pile of cogweels and forcing me to memorize location of things/read the description is to fix the source code (at every update).
The only excuse I might accept is that it's other more serious bugs to fix first but we now talking several months so it needs to be revisited.
Comment 15 JG 2012-09-18 10:23:49 UTC
I don't understand how the kde developers can make such a decision!
We have more then 2000 users, most of them using kde, all homes are
nfs-mounted, and now all the icons are gone!
Is kde made for private use only? 
And no, for us its not only a minor bug, because the missing icons is 
the first thing every user sees after the upgrade! And they are complaining.
I hope this will be considered a real bug and they will debug it very soon.
Comment 16 Christoph Feck 2012-09-18 11:10:48 UTC
> Is kde made for private use only? 

KDE is made by those who contribute. If you found a bug that prominently shows in cooperate setups, please consider contributing by providing patches, or by hiring a commercial developer to fix the issue.
Comment 17 Gerhard 2012-10-09 10:23:23 UTC
This "bug" was deliberately introduced as a workaround for a problem that is maybe present with a slow network only. I've personally never seen a problem as it was before, so why can't this workaround just be reverted? It's not a question that some professional developer in a corporate environment has to track down the reason for this problem, it's rather questionable why such a "feature" was introduced.
Comment 18 Alberto Planas 2012-12-05 13:54:45 UTC
There is an small workaround, indicated by Rex Dieter here in this thread. You can move the $HOME/Desktop directory in a local path (/home/user-local, for example) and make a soft link (ln -s /home/user-local/Desktop .). It is not pretty, but it can be automated for every new installation.
Comment 19 Ignat Semenov 2012-12-30 15:41:33 UTC
*** Bug 291138 has been marked as a duplicate of this bug. ***
Comment 20 Sebastian 2013-01-25 09:15:12 UTC
What about adding a configuration option, so that everyone can decide for himself, if speed or user experience is more important?
Moreover, the workaround is no real one, cause /home on NFS is usually used for switching PCs and still having the same configuration and files.
Comment 21 David Faure 2013-03-22 20:04:17 UTC
I just implemented delayed icon loading on slow mountpoints, for desktop files
and directories.

Thanks to Martin Koller for the initial idea behind this patch.

Could you test it on an actual slow mount? (I simulated it locally to test the code path, but speed wise it's different of course).

Patch for kdelibs:
http://www.davidfaure.fr/2013/delayed_icon_loading_kio.diff

Patch for dolphin:
http://www.davidfaure.fr/2013/delayed_icon_loading_dolphin.diff
Comment 22 David Faure 2013-03-27 08:23:03 UTC
13+ people ready to complain, nobody ready to test the fix?
Comment 23 David Faure 2013-03-27 13:59:38 UTC
Git commit 6369b556ae9beef6888699d23b91326bac950ba4 by David Faure.
Committed on 27/03/2013 at 14:29.
Pushed by dfaure into branch 'KDE/4.10'.

Implement delayed loading of slow icons (from .desktop or .directory files)

Thanks to Pierre Sauter for making me fix this, and for testing that it
works over sshfs.

FIXED-IN: 4.10.2

M  +19   -3    kio/kio/kfileitem.cpp
M  +6    -0    kio/kio/kfileitem.h
M  +2    -0    kio/tests/kfileitemtest.cpp
 
http://commits.kde.org/kdelibs/6369b556ae9beef6888699d23b91326bac950ba4
Comment 24 David Faure 2013-03-27 14:16:47 UTC
Git commit b8c9aa55ff06b8bd540f1fa7941e0eb4a3572040 by David Faure.
Committed on 27/03/2013 at 14:32.
Pushed by dfaure into branch 'KDE/4.10'.

Update icon if it couldn't be determined upfront (.desktop file on slow mount)

This requires an up-to-date kdelibs >= 4.10.

M  +1    -1    dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp

http://commits.kde.org/kde-baseapps/b8c9aa55ff06b8bd540f1fa7941e0eb4a3572040
Comment 25 gustavo 2013-05-23 20:47:18 UTC
Created attachment 80049 [details]
fixed debian package for Ubuntu 12.04 i686 and x64
Comment 26 gustavo 2013-05-23 20:51:01 UTC
I attached packages for Ubuntu 12.04 i686 and x64 - this is for kdelibs < 4.10 and is based on 

https://bugs.kde.org/show_bug.cgi?id=288824#c47

It just disables the slow attribute for NFS and SMB.