[nautilus] Remove Go to Computer location



commit 331860440c50a979bcbeafa401d48490c758db5a
Author: William Jon McCann <jmccann redhat com>
Date:   Fri May 25 14:41:03 2012 -0400

    Remove Go to Computer location
    
    This isn't required for anything anymore and it is a bit broken. The
    properties dialogs don't show anything useful.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676841

 .../nautilus-desktop-link-monitor.c                |   26 ------------
 libnautilus-private/nautilus-desktop-link.c        |   43 +-------------------
 libnautilus-private/nautilus-desktop-link.h        |    1 -
 libnautilus-private/nautilus-directory.h           |    2 +-
 libnautilus-private/nautilus-global-preferences.h  |    2 -
 libnautilus-private/nautilus-icon-names.h          |    1 -
 libnautilus-private/nautilus.convert               |    2 -
 .../org.gnome.nautilus.gschema.xml.in              |   10 -----
 src/nautilus-icon-view-container.c                 |   15 ++-----
 src/nautilus-shell-ui.xml                          |    1 -
 src/nautilus-window-menus.c                        |   23 ----------
 11 files changed, 7 insertions(+), 119 deletions(-)
---
diff --git a/libnautilus-private/nautilus-desktop-link-monitor.c b/libnautilus-private/nautilus-desktop-link-monitor.c
index 1e0ade7..8925ecd 100644
--- a/libnautilus-private/nautilus-desktop-link-monitor.c
+++ b/libnautilus-private/nautilus-desktop-link-monitor.c
@@ -44,7 +44,6 @@ struct NautilusDesktopLinkMonitorDetails {
 	NautilusDirectory *desktop_dir;
 	
 	NautilusDesktopLink *home_link;
-	NautilusDesktopLink *computer_link;
 	NautilusDesktopLink *trash_link;
 	NautilusDesktopLink *network_link;
 
@@ -125,7 +124,6 @@ nautilus_desktop_link_monitor_delete_link (NautilusDesktopLinkMonitor *monitor,
 {
 	switch (nautilus_desktop_link_get_link_type (link)) {
 	case NAUTILUS_DESKTOP_LINK_HOME:
-	case NAUTILUS_DESKTOP_LINK_COMPUTER:
 	case NAUTILUS_DESKTOP_LINK_TRASH:
 	case NAUTILUS_DESKTOP_LINK_NETWORK:
 		/* just ignore. We don't allow you to delete these */
@@ -301,19 +299,6 @@ desktop_home_visible_changed (gpointer callback_data)
 }
 
 static void
-desktop_computer_visible_changed (gpointer callback_data)
-{
-	NautilusDesktopLinkMonitor *monitor;
-
-	monitor = NAUTILUS_DESKTOP_LINK_MONITOR (callback_data);
-
-	update_link_visibility (NAUTILUS_DESKTOP_LINK_MONITOR (callback_data),
-				&monitor->details->computer_link,
-				NAUTILUS_DESKTOP_LINK_COMPUTER,
-				NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE);
-}
-
-static void
 desktop_trash_visible_changed (gpointer callback_data)
 {
 	NautilusDesktopLinkMonitor *monitor;
@@ -408,12 +393,6 @@ nautilus_desktop_link_monitor_init (NautilusDesktopLinkMonitor *monitor)
 					G_CALLBACK (desktop_home_visible_changed),
 					monitor);
 
-	create_link_and_add_preference (&monitor->details->computer_link,
-					NAUTILUS_DESKTOP_LINK_COMPUTER,
-					NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE,
-					G_CALLBACK (desktop_computer_visible_changed),
-					monitor);
-
 	create_link_and_add_preference (&monitor->details->trash_link,
 					NAUTILUS_DESKTOP_LINK_TRASH,
 					NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE,
@@ -484,11 +463,6 @@ desktop_link_monitor_finalize (GObject *object)
 				    G_CALLBACK (desktop_home_visible_changed),
 				    monitor);
 
-	remove_link_and_preference (&monitor->details->computer_link,
-				    NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE,
-				    G_CALLBACK (desktop_computer_visible_changed),
-				    monitor);
-
 	remove_link_and_preference (&monitor->details->trash_link,
 				    NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE,
 				    G_CALLBACK (desktop_trash_visible_changed),
diff --git a/libnautilus-private/nautilus-desktop-link.c b/libnautilus-private/nautilus-desktop-link.c
index b34f5f8..65e7358 100644
--- a/libnautilus-private/nautilus-desktop-link.c
+++ b/libnautilus-private/nautilus-desktop-link.c
@@ -124,21 +124,6 @@ home_name_changed (gpointer callback_data)
 }
 
 static void
-computer_name_changed (gpointer callback_data)
-{
-	NautilusDesktopLink *link;
-
-	link = NAUTILUS_DESKTOP_LINK (callback_data);
-	g_assert (link->details->type == NAUTILUS_DESKTOP_LINK_COMPUTER);
-
-	g_free (link->details->display_name);
-	link->details->display_name = g_settings_get_string (nautilus_desktop_preferences,
-							     NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME);
-
-	nautilus_desktop_link_changed (link);
-}
-
-static void
 trash_name_changed (gpointer callback_data)
 {
 	NautilusDesktopLink *link;
@@ -188,20 +173,6 @@ nautilus_desktop_link_new (NautilusDesktopLinkType type)
 					  link);
 		break;
 
-	case NAUTILUS_DESKTOP_LINK_COMPUTER:
-		link->details->filename = g_strdup ("computer");
-		link->details->display_name = g_settings_get_string (nautilus_desktop_preferences,
-								     NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME);
-		link->details->activation_location = g_file_new_for_uri ("computer:///");
-		/* TODO: This might need a different icon: */
-		link->details->icon = g_themed_icon_new (NAUTILUS_ICON_COMPUTER);
-
-		g_signal_connect_swapped (nautilus_desktop_preferences,
-					  "changed::" NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME,
-					  G_CALLBACK (computer_name_changed),
-					  link);
-		break;
-
 	case NAUTILUS_DESKTOP_LINK_TRASH:
 		link->details->filename = g_strdup ("trash");
 		link->details->display_name = g_settings_get_string (nautilus_desktop_preferences,
@@ -356,8 +327,7 @@ nautilus_desktop_link_can_rename (NautilusDesktopLink     *link)
 {
 	return (link->details->type == NAUTILUS_DESKTOP_LINK_HOME ||
 		link->details->type == NAUTILUS_DESKTOP_LINK_TRASH ||
-		link->details->type == NAUTILUS_DESKTOP_LINK_NETWORK ||
-		link->details->type == NAUTILUS_DESKTOP_LINK_COMPUTER);
+		link->details->type == NAUTILUS_DESKTOP_LINK_NETWORK);
 }
 
 gboolean
@@ -370,11 +340,6 @@ nautilus_desktop_link_rename (NautilusDesktopLink     *link,
 				       NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME,
 				       name);
 		break;
-	case NAUTILUS_DESKTOP_LINK_COMPUTER:
-		g_settings_set_string (nautilus_desktop_preferences,
-				       NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME,
-				       name);
-		break;
 	case NAUTILUS_DESKTOP_LINK_TRASH:
 		g_settings_set_string (nautilus_desktop_preferences,
 				       NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME,
@@ -427,12 +392,6 @@ desktop_link_finalize (GObject *object)
 						 link);
 	}
 
-	if (link->details->type == NAUTILUS_DESKTOP_LINK_COMPUTER) {
-		g_signal_handlers_disconnect_by_func (nautilus_desktop_preferences,
-						      computer_name_changed,
-						      link);
-	}
-
 	if (link->details->type == NAUTILUS_DESKTOP_LINK_TRASH) {
 		g_signal_handlers_disconnect_by_func (nautilus_desktop_preferences,
 						      trash_name_changed,
diff --git a/libnautilus-private/nautilus-desktop-link.h b/libnautilus-private/nautilus-desktop-link.h
index 5327eca..0cfa3d9 100644
--- a/libnautilus-private/nautilus-desktop-link.h
+++ b/libnautilus-private/nautilus-desktop-link.h
@@ -53,7 +53,6 @@ typedef struct {
 
 typedef enum {
 	NAUTILUS_DESKTOP_LINK_HOME,
-	NAUTILUS_DESKTOP_LINK_COMPUTER,
 	NAUTILUS_DESKTOP_LINK_TRASH,
 	NAUTILUS_DESKTOP_LINK_MOUNT,
 	NAUTILUS_DESKTOP_LINK_NETWORK
diff --git a/libnautilus-private/nautilus-directory.h b/libnautilus-private/nautilus-directory.h
index 22d40eb..3a628ec 100644
--- a/libnautilus-private/nautilus-directory.h
+++ b/libnautilus-private/nautilus-directory.h
@@ -131,7 +131,7 @@ typedef struct
 	 * customize collecting the list of files in a directory.
 	 * For example, the NautilusDesktopDirectory overrides this so that it can
 	 * merge together the list of files in the $HOME/Desktop directory with
-	 * the list of standard icons (Computer, Home, Trash) on the desktop.
+	 * the list of standard icons (Home, Trash) on the desktop.
 	 */
 	GList *	 (* get_file_list)	 (NautilusDirectory *directory);
 
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 92eb6d4..c9ed637 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -163,8 +163,6 @@ typedef enum
 #define NAUTILUS_PREFERENCES_DESKTOP_FONT		   "font"
 #define NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE          "home-icon-visible"
 #define NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME             "home-icon-name"
-#define NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_VISIBLE      "computer-icon-visible"
-#define NAUTILUS_PREFERENCES_DESKTOP_COMPUTER_NAME         "computer-icon-name"
 #define NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE         "trash-icon-visible"
 #define NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME            "trash-icon-name"
 #define NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE	   "volumes-visible"
diff --git a/libnautilus-private/nautilus-icon-names.h b/libnautilus-private/nautilus-icon-names.h
index 97226ce..a012c3f 100644
--- a/libnautilus-private/nautilus-icon-names.h
+++ b/libnautilus-private/nautilus-icon-names.h
@@ -2,7 +2,6 @@
 #define NAUTILUS_ICON_NAMES_H
 
 /* Icons for places */
-#define NAUTILUS_ICON_COMPUTER		"computer"
 #define NAUTILUS_ICON_DESKTOP		"user-desktop"
 #define NAUTILUS_ICON_FILESYSTEM	"drive-harddisk-system"
 #define NAUTILUS_ICON_FOLDER		"folder"
diff --git a/libnautilus-private/nautilus.convert b/libnautilus-private/nautilus.convert
index 41603d5..83bdb34 100644
--- a/libnautilus-private/nautilus.convert
+++ b/libnautilus-private/nautilus.convert
@@ -44,11 +44,9 @@ show-only-directories = /apps/nautilus/sidebar_panels/tree/show_only_directories
 [org.gnome.nautilus.desktop]
 font = /apps/nautilus/preferences/desktop_font
 home-icon-visible = /apps/nautilus/desktop/home_icon_visible
-computer-icon-visible = /apps/nautilus/desktop/computer_icon_visible
 trash-icon-visible = /apps/nautilus/desktop/trash_icon_visible
 volumes-visible = /apps/nautilus/desktop/volumes_visible
 network-icon-visible = /apps/nautilus/desktop/network_icon_visible
-computer-icon-name = /apps/nautilus/desktop/computer_icon_name
 home-icon-name = /apps/nautilus/desktop/home_icon_name
 trash-icon-name = /apps/nautilus/desktop/trash_icon_name
 network-icon-name = /apps/nautilus/desktop/network_icon_name
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index 846d880..97ff9cb 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -299,11 +299,6 @@
       <_summary>Home icon visible on desktop</_summary>
       <_description>If this is set to true, an icon linking to the home folder will be put on the desktop.</_description>
     </key>
-    <key name="computer-icon-visible" type="b">
-      <default>true</default>
-      <_summary>Computer icon visible on desktop</_summary>
-      <_description>If this is set to true, an icon linking to the computer location will be put on the desktop.</_description>
-    </key>
     <key name="trash-icon-visible" type="b">
       <default>true</default>
       <_summary>Trash icon visible on desktop</_summary>
@@ -319,11 +314,6 @@
       <_summary>Network Servers icon visible on the desktop</_summary>
       <_description>If this is set to true, an icon linking to the Network Servers view will be put on the desktop.</_description>
     </key>
-    <key name="computer-icon-name" type="s">
-      <default l10n="messages" context="computer-icon-name">'Computer'</default>
-      <_summary>Desktop computer icon name</_summary>
-      <_description>This name can be set if you want a custom name for the computer icon on the desktop.</_description>
-    </key>
     <key name="home-icon-name" type="s">
       <default>''</default>
       <_summary>Desktop home icon name</_summary>
diff --git a/src/nautilus-icon-view-container.c b/src/nautilus-icon-view-container.c
index 4c986ac..c914816 100644
--- a/src/nautilus-icon-view-container.c
+++ b/src/nautilus-icon-view-container.c
@@ -404,15 +404,13 @@ nautilus_icon_view_container_get_icon_text (NautilusIconContainer *container,
 }
 
 /* Sort as follows:
- *   0) computer link
- *   1) home link
- *   2) network link
- *   3) mount links
- *   4) other
- *   5) trash link
+ *   0) home link
+ *   1) network link
+ *   2) mount links
+ *   3) other
+ *   4) trash link
  */
 typedef enum {
-	SORT_COMPUTER_LINK,
 	SORT_HOME_LINK,
 	SORT_NETWORK_LINK,
 	SORT_MOUNT_LINK,
@@ -432,9 +430,6 @@ get_sort_category (NautilusFile *file)
 		link = nautilus_desktop_icon_file_get_link (NAUTILUS_DESKTOP_ICON_FILE (file));
 		if (link != NULL) {
 			switch (nautilus_desktop_link_get_link_type (link)) {
-			case NAUTILUS_DESKTOP_LINK_COMPUTER:
-				category = SORT_COMPUTER_LINK;
-				break;
 			case NAUTILUS_DESKTOP_LINK_HOME:
 				category = SORT_HOME_LINK;
 				break;
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 325756a..93da7cd 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -92,7 +92,6 @@
 	                </placeholder>
 	                <separator/>
 			<menuitem name="Home" action="Home"/>
-			<menuitem name="Computer" action="Go to Computer"/>
 			<menuitem name="Go to Templates" action="Go to Templates"/>
 			<menuitem name="Go to Trash" action="Go to Trash"/>
 		        <menuitem name="Go to Network" action="Go to Network"/>
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 1a76fd8..7266e2e 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -64,7 +64,6 @@
 #define POPUP_PATH_EXTENSION_ACTIONS                     "/background/Before Zoom Items/Extension Actions"
 
 #define NETWORK_URI          "network:"
-#define COMPUTER_URI         "computer:"
 
 static void
 action_close_window_slot_callback (GtkAction *action,
@@ -115,23 +114,6 @@ action_home_callback (GtkAction *action,
 }
 
 static void
-action_go_to_computer_callback (GtkAction *action, 
-				gpointer user_data) 
-{
-	NautilusWindow *window;
-	NautilusWindowSlot *slot;
-	GFile *computer;
-
-	window = NAUTILUS_WINDOW (user_data);
-	slot = nautilus_window_get_active_slot (window);
-
-	computer = g_file_new_for_uri (COMPUTER_URI);
-	nautilus_window_slot_open_location (slot, computer,
-					    nautilus_event_get_window_open_flags ());
-	g_object_unref (computer);
-}
-
-static void
 action_go_to_network_callback (GtkAction *action, 
 				gpointer user_data) 
 {
@@ -594,7 +576,6 @@ connect_proxy_cb (GtkActionGroup *action_group,
 
 static const char* icon_entries[] = {
 	"/MenuBar/Other Menus/Go/Home",
-	"/MenuBar/Other Menus/Go/Computer",
 	"/MenuBar/Other Menus/Go/Go to Templates",
 	"/MenuBar/Other Menus/Go/Go to Trash",
 	"/MenuBar/Other Menus/Go/Go to Network",
@@ -820,10 +801,6 @@ static const GtkActionEntry main_entries[] = {
   /* label, accelerator */       N_("_Home"), "<alt>Home",
   /* tooltip */                  N_("Open your personal folder"),
                                  G_CALLBACK (action_home_callback) },
-  /* name, stock id */         { "Go to Computer", NAUTILUS_ICON_COMPUTER,
-  /* label, accelerator */       N_("_Computer"), NULL,
-  /* tooltip */                  N_("Browse all local and remote disks and folders accessible from this computer"),
-                                 G_CALLBACK (action_go_to_computer_callback) },
   /* name, stock id */         { "Go to Network", NAUTILUS_ICON_NETWORK,
   /* label, accelerator */       N_("_Network"), NULL,
   /* tooltip */                  N_("Browse bookmarked and local network locations"),



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