GNOME Bugzilla – Bug 416546
nautilus modifies .desktop files when viewing properties
Last modified: 2010-07-07 21:46:13 UTC
The bug has been opened on https://launchpad.net/ubuntu/+source/nautilus/+bug/89209 "Binary package hint: nautilus Create a .desktop file with the contents: [Desktop Entry] Name=Ubuntu Type=Link URL=http://www.ubuntu.com Now start nautilus, right-click the file, select properties. Click on the "Link" tab. At this instant the files has been modified without actually changing the fields. The contents are now: [Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Ubuntu Type=Link URL=http://www.ubuntu.com GenericName[en_US]= A file manager should *never* change a file without user consent."
error: required key "Encoding" not found Thus is is actually an invalid .desktop file fed to nautilus. Adding the "Encoding" Property is in my opinion a feature, not a bug ;) However, I have no idea why the Version and GenericName fields are added. I see no reason for this. Can someone shed light on this?
I agree that the original .desktop file might have been invalid. However, even if .desktop files are special to nautilus, nautilus should not change them without user consent. Someone or some program could use files that have a ".desktop" suffix without having anything to do with freedesktop .desktop files. In a heterogeneous world it's not good for nautilus to assume that every .desktop file must have the format it expects and if it does not to modify it. When browsing and viewing properties in the properties dialog, I don't expect a file browser to change anything at all until I actually click somewhere. Just selecting the "Link" tab is not enough to assume user consent to modify the file. File modification should not take place until the user actually types something inside the text boxes. However, this might be non critical since most of the files with a ".desktop" suffix are actually intended to be freedesktop .desktop files. Nevertheless, I believe that being conservative is important when dealing with data corruption - no matter how improbable it may seem.
obsolete . Maybe due to freedesktop standard change. Anyway it cannot be reproduced on version 2.30
Being the initial bug reporter, I fully agree. This can be closed.
Closing as per comment #4.