[nautilus] Don't set zoom level per folder



commit 24cddd96bb717b98c4f42fed95dfbd43a6a92915
Author: William Jon McCann <jmccann redhat com>
Date:   Mon Aug 20 15:39:40 2012 -0400

    Don't set zoom level per folder
    
    Since this is now a per view option.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682017

 libnautilus-private/nautilus-metadata.c |    2 -
 libnautilus-private/nautilus-metadata.h |    2 -
 src/nautilus-canvas-view.c              |   44 -------------------------
 src/nautilus-convert-metadata.c         |    2 -
 src/nautilus-list-view.c                |   54 -------------------------------
 5 files changed, 0 insertions(+), 104 deletions(-)
---
diff --git a/libnautilus-private/nautilus-metadata.c b/libnautilus-private/nautilus-metadata.c
index 1cfb35f..def85ea 100644
--- a/libnautilus-private/nautilus-metadata.c
+++ b/libnautilus-private/nautilus-metadata.c
@@ -27,13 +27,11 @@
 static char *used_metadata_names[] = {
   NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
   NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE,
-  NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
   NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT,
   NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY,
   NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED,
   NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED,
   NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP,
-  NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL,
   NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN,
   NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED,
   NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS,
diff --git a/libnautilus-private/nautilus-metadata.h b/libnautilus-private/nautilus-metadata.h
index 2460f96..d7ee6de 100644
--- a/libnautilus-private/nautilus-metadata.h
+++ b/libnautilus-private/nautilus-metadata.h
@@ -37,14 +37,12 @@
 #define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR 	"folder-background-color"
 #define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE 	"folder-background-image"
 
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL       	"nautilus-icon-view-zoom-level"
 #define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT      	"nautilus-icon-view-auto-layout"
 #define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY          	"nautilus-icon-view-sort-by"
 #define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED    	"nautilus-icon-view-sort-reversed"
 #define NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED            "nautilus-icon-view-keep-aligned"
 #define NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP	"nautilus-icon-view-layout-timestamp"
 
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL       	"nautilus-list-view-zoom-level"
 #define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN      	"nautilus-list-view-sort-column"
 #define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED    	"nautilus-list-view-sort-reversed"
 #define NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS    	"nautilus-list-view-visible-columns"
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 555f9df..d2752b7 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -877,7 +877,6 @@ nautilus_canvas_view_begin_loading (NautilusView *view)
 	NautilusCanvasView *canvas_view;
 	GtkWidget *canvas_container;
 	NautilusFile *file;
-	int level;
 	char *sort_name, *uri;
 
 	g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
@@ -894,14 +893,6 @@ nautilus_canvas_view_begin_loading (NautilusView *view)
 
 	g_free (uri);
 
-	/* Set up the zoom level from the metadata. */
-	if (nautilus_view_supports_zooming (NAUTILUS_VIEW (canvas_view))) {
-		level = nautilus_file_get_integer_metadata (file, 
-							    NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL, 
-							    get_default_zoom_level (canvas_view));
-		nautilus_canvas_view_set_zoom_level (canvas_view, level, TRUE);
-	}
-
 	/* Set the sort mode.
 	 * It's OK not to resort the icons because the
 	 * container doesn't have any icons at this point.
@@ -992,12 +983,6 @@ nautilus_canvas_view_set_zoom_level (NautilusCanvasView *view,
 		return;
 	}
 
-	nautilus_file_set_integer_metadata
-		(nautilus_view_get_directory_as_file (NAUTILUS_VIEW (view)), 
-		 NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL, 
-		 get_default_zoom_level (view),
-		 new_level);
-
 	nautilus_canvas_container_set_zoom_level (canvas_container, new_level);
 
 	g_signal_emit_by_name (view, "zoom_level_changed");
@@ -1931,28 +1916,6 @@ default_sort_in_reverse_order_changed_callback (gpointer callback_data)
 }
 
 static void
-default_zoom_level_changed_callback (gpointer callback_data)
-{
-	NautilusCanvasView *canvas_view;
-	NautilusFile *file;
-	int level;
-
-	g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (callback_data));
-
-	canvas_view = NAUTILUS_CANVAS_VIEW (callback_data);
-
-	if (nautilus_view_supports_zooming (NAUTILUS_VIEW (canvas_view))) {
-		file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
-
-		level = nautilus_file_get_integer_metadata (file, 
-							    NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL, 
-							    get_default_zoom_level (canvas_view));
-
-		nautilus_view_zoom_to_level (NAUTILUS_VIEW (canvas_view), level);
-	}
-}
-
-static void
 nautilus_canvas_view_sort_directories_first_changed (NautilusView *directory_view)
 {
 	NautilusCanvasView *canvas_view;
@@ -2284,9 +2247,6 @@ nautilus_canvas_view_finalize (GObject *object)
 					      canvas_view);
 
 	g_signal_handlers_disconnect_by_func (nautilus_icon_view_preferences,
-					      default_zoom_level_changed_callback,
-					      canvas_view);
-	g_signal_handlers_disconnect_by_func (nautilus_icon_view_preferences,
 					      text_attribute_names_changed_callback,
 					      canvas_view);
 
@@ -2410,10 +2370,6 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view)
 				  canvas_view);
 
 	g_signal_connect_swapped (nautilus_icon_view_preferences,
-				  "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
-				  G_CALLBACK (default_zoom_level_changed_callback),
-				  canvas_view);
-	g_signal_connect_swapped (nautilus_icon_view_preferences,
 				  "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS,
 				  G_CALLBACK (text_attribute_names_changed_callback),
 				  canvas_view);
diff --git a/src/nautilus-convert-metadata.c b/src/nautilus-convert-metadata.c
index f1981f0..cf9053a 100644
--- a/src/nautilus-convert-metadata.c
+++ b/src/nautilus-convert-metadata.c
@@ -91,13 +91,11 @@ static struct {
 } metadata_keys[] = {
 	{"background_color", "metadata::" NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR},
 	{"background_tile_image", "metadata::" NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE},
-	{"icon_view_zoom_level", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL},
 	{"icon_view_auto_layout", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT},
 	{"icon_view_sort_by", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY},
 	{"icon_view_sort_reversed", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED},
 	{"icon_view_keep_aligned", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED},
 	{"icon_view_layout_timestamp", "metadata::" NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP},
-	{"list_view_zoom_level", "metadata::" NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL},
 	{"list_view_sort_column", "metadata::" NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN},
 	{"list_view_sort_reversed", "metadata::" NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED},
 	{"list_view_visible_columns", "metadata::" NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS},
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 90d4089..4b1b7d5 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -1863,16 +1863,6 @@ set_sort_order_from_metadata_and_preferences (NautilusListView *list_view)
 					      sort_reversed ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING);					      
 }
 
-static gboolean
-list_view_changed_foreach (GtkTreeModel *model,
-              		   GtkTreePath  *path,
-			   GtkTreeIter  *iter,
-			   gpointer      data)
-{
-	gtk_tree_model_row_changed (model, path, iter);
-	return FALSE;
-}
-
 static NautilusZoomLevel
 get_default_zoom_level (void) {
 	NautilusZoomLevel default_zoom_level;
@@ -1889,25 +1879,6 @@ get_default_zoom_level (void) {
 }
 
 static void
-set_zoom_level_from_metadata_and_preferences (NautilusListView *list_view)
-{
-	NautilusFile *file;
-	int level;
-
-	if (nautilus_view_supports_zooming (NAUTILUS_VIEW (list_view))) {
-		file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
-		level = nautilus_file_get_integer_metadata (file,
-							    NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL, 
-							    get_default_zoom_level ());
-		nautilus_list_view_set_zoom_level (list_view, level, TRUE);
-		
-		/* updated the rows after updating the font size */
-		gtk_tree_model_foreach (GTK_TREE_MODEL (list_view->details->model),
-					list_view_changed_foreach, NULL);
-	}
-}
-
-static void
 nautilus_list_view_begin_loading (NautilusView *view)
 {
 	NautilusListView *list_view;
@@ -1915,7 +1886,6 @@ nautilus_list_view_begin_loading (NautilusView *view)
 	list_view = NAUTILUS_LIST_VIEW (view);
 
 	set_sort_order_from_metadata_and_preferences (list_view);
-	set_zoom_level_from_metadata_and_preferences (list_view);
 	set_columns_settings_from_metadata_and_preferences (list_view);
 }
 
@@ -2705,7 +2675,6 @@ nautilus_list_view_reset_to_defaults (NautilusView *view)
 
 	nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN, NULL, NULL);
 	nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED, NULL, NULL);
-	nautilus_file_set_metadata (file, NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL, NULL, NULL);
 	nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER, NULL);
 	nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS, NULL);
 
@@ -2743,12 +2712,6 @@ nautilus_list_view_set_zoom_level (NautilusListView *view,
 	view->details->zoom_level = new_level;
 	g_signal_emit_by_name (NAUTILUS_VIEW(view), "zoom_level_changed");
 
-	nautilus_file_set_integer_metadata
-		(nautilus_view_get_directory_as_file (NAUTILUS_VIEW (view)), 
-		 NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL, 
-		 get_default_zoom_level (),
-		 new_level);
-
 	/* Select correctly scaled icons. */
 	column = nautilus_list_model_get_column_id_from_zoom_level (new_level);
 	gtk_tree_view_column_set_attributes (view->details->file_name_column,
@@ -2950,16 +2913,6 @@ default_sort_order_changed_callback (gpointer callback_data)
 }
 
 static void
-default_zoom_level_changed_callback (gpointer callback_data)
-{
-	NautilusListView *list_view;
-
-	list_view = NAUTILUS_LIST_VIEW (callback_data);
-
-	set_zoom_level_from_metadata_and_preferences (list_view);
-}
-
-static void
 default_visible_columns_changed_callback (gpointer callback_data)
 {
 	NautilusListView *list_view;
@@ -3076,9 +3029,6 @@ nautilus_list_view_finalize (GObject *object)
 					      default_sort_order_changed_callback,
 					      list_view);
 	g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
-					      default_zoom_level_changed_callback,
-					      list_view);
-	g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
 					      default_visible_columns_changed_callback,
 					      list_view);
 	g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
@@ -3262,10 +3212,6 @@ nautilus_list_view_init (NautilusListView *list_view)
 				  G_CALLBACK (default_sort_order_changed_callback),
 				  list_view);
 	g_signal_connect_swapped (nautilus_list_view_preferences,
-				  "changed::" NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
-				  G_CALLBACK (default_zoom_level_changed_callback),
-				  list_view);
-	g_signal_connect_swapped (nautilus_list_view_preferences,
 				  "changed::" NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_VISIBLE_COLUMNS,
 				  G_CALLBACK (default_visible_columns_changed_callback),
 				  list_view);



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