After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606922 - duplicate entries for the home directory if desktop is home dir
duplicate entries for the home directory if desktop is home dir
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-01-14 02:16 UTC by Jean-François Fortin Tam
Modified: 2010-01-20 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[Places] Hide desktop icon when desktop_is_home_dir (3.05 KB, patch)
2010-01-15 11:40 UTC, Florian Müllner
committed Details | Review

Description Jean-François Fortin Tam 2010-01-14 02:16:54 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.
Comment 1 Florian Müllner 2010-01-15 11:40:31 UTC
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.
Comment 2 Marina Zhurakhinskaya 2010-01-20 21:44:38 UTC
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.
Comment 3 Florian Müllner 2010-01-20 22:28:50 UTC
Attachment 151462 [details] pushed as 74446ce - [Places] Hide desktop icon when desktop_is_home_dir
with the small changes indicated above by Marina.