GNOME Bugzilla – Bug 606922
duplicate entries for the home directory if desktop is home dir
Last modified: 2010-01-20 22:28:55 UTC
Set the /apps/nautilus/preferences/desktop_is_home_dir gconf key to True, and you will see two the home directory twice in the Shell's "places & devices" section. Using the jhbuild version.
Created attachment 151462 [details] [review] [Places] Hide desktop icon when desktop_is_home_dir With the above preference set to true, the home and desktop entries both represent the same location. Hide the desktop icon in that case to avoid redundancy.
Review of attachment 151462 [details] [review]: Looks great, and works as expected. Feel free to commit after making the suggested changes. ::: js/ui/placeDisplay.js @@ +383,3 @@ + + _removeById: function(sourceArray, id) { + for (let i = 0; i < sourceArray.length; i++) { There is a slight duplication of code between _lookupById() and _removeById(). Here is how I think the relevant functions can be refactored. _lookupIndexById: function(sourceArray, id) { for (let i = 0; i < sourceArray.length; i++) { let place = sourceArray[i]; if (place.id == id) return i; } return -1; }, lookupPlaceById: function(id) { let colonIdx = id.indexOf(':'); let type = id.substring(0, colonIdx); let sourceArray = null; if (type == 'special') sourceArray = this._defaultPlaces; else if (type == 'mount') sourceArray = this._mounts; else if (type == 'bookmark') sourceArray = this._bookmarks; return sourceArray[this._lookupIndexById(sourceArray, id)]; }, _removeById: function(sourceArray, id) { sourceArray.splice(this._lookupIndexById(sourceArray, id), 1); } @@ +393,3 @@ + + removePlaceById: function(id) { + let colonIdx = id.indexOf(':'); This function is not used.
Attachment 151462 [details] pushed as 74446ce - [Places] Hide desktop icon when desktop_is_home_dir with the small changes indicated above by Marina.