[Nautilus-list] [PATCH] Don't recreate the home directory link when desktop==home



Changelog:

2002-03-21  David Emory Watson  <dwatson cs ucr edu>

	* src/file-manager/fm-desktop-icon-view.c:
	(update_home_link_and_delete_copies): Don't recreate the home
	directory link when desktop==home.
	(is_link_type_special): Pretend that the home directory link is
	normal when desktop==home so that the user can delete it.

Caveat - My change to is_link_type_special () is not enough to allow
users to delete their home directory link.  There is probably another
one line change needed in the code that actually implements delete. 
Until I find that line, you will need to use the command line to remove
your home directory.

Index: src/file-manager/fm-desktop-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-desktop-icon-view.c,v
retrieving revision 1.164
diff -p -u -r1.164 fm-desktop-icon-view.c
--- src/file-manager/fm-desktop-icon-view.c	7 Mar 2002 19:36:16 -0000	1.164
+++ src/file-manager/fm-desktop-icon-view.c	21 Mar 2002 20:46:05 -0000
@@ -879,7 +879,8 @@ update_home_link_and_delete_copies (void
 	
 	if (!update_link_and_delete_copies (nautilus_link_local_is_home_link,
 					    NULL,
-					    home_uri)) {
+					    home_uri)
+ 	    && !eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR)) {
 		nautilus_link_local_create (desktop_directory,
 					    home_link_name,
 					    "desktop-home", 
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.521
diff -p -u -r1.521 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	18 Mar 2002 17:21:48 -0000	1.521
+++ src/file-manager/fm-directory-view.c	21 Mar 2002 20:46:19 -0000
@@ -2844,9 +2844,14 @@ fm_directory_link_type_in_selection (FMD
 static gboolean
 is_link_type_special (NautilusLinkType type)
 {
-	switch (type) {
+	switch (type) 
+{	case NAUTILUS_LINK_HOME:
+		if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR)) {
+			return TRUE;
+ 		} else {
+ 			return FALSE;
+ 		}
 	case NAUTILUS_LINK_TRASH:
-	case NAUTILUS_LINK_HOME:
 	case NAUTILUS_LINK_MOUNT:
 		return TRUE;
 	case NAUTILUS_LINK_GENERIC:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]