Commit 24cddd96 authored by William Jon McCann's avatar William Jon McCann

Don't set zoom level per folder

Since this is now a per view option.

https://bugzilla.gnome.org/show_bug.cgi?id=682017
parent ab9ed7c1
......@@ -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,
......
......@@ -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"
......
......@@ -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");
......@@ -1930,28 +1915,6 @@ default_sort_in_reverse_order_changed_callback (gpointer callback_data)
nautilus_canvas_container_request_update_all (canvas_container);
}
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)
{
......@@ -2283,9 +2246,6 @@ nautilus_canvas_view_finalize (GObject *object)
image_display_policy_changed_callback,
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);
......@@ -2409,10 +2369,6 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view)
G_CALLBACK (image_display_policy_changed_callback),
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),
......
......@@ -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},
......
......@@ -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;
......@@ -1888,25 +1878,6 @@ get_default_zoom_level (void) {
return default_zoom_level;
}
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)
{
......@@ -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,
......@@ -2949,16 +2912,6 @@ default_sort_order_changed_callback (gpointer callback_data)
set_sort_order_from_metadata_and_preferences (list_view);
}
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)
{
......@@ -3075,9 +3028,6 @@ nautilus_list_view_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (nautilus_preferences,
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);
......@@ -3261,10 +3211,6 @@ nautilus_list_view_init (NautilusListView *list_view)
"changed::" NAUTILUS_PREFERENCES_DEFAULT_SORT_IN_REVERSE_ORDER,
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),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment