Commit ab9ed7c1 authored by William Jon McCann's avatar William Jon McCann

make view mode persistant to window, not folder

We now have a nicely exposed view mode toggle on the toolbar. When traversing
the hierarchy it feels wring the view changes. I think it makes more sense to
relate the view mode to the window rather than the folder/location.

https://bugzilla.gnome.org/show_bug.cgi?id=682017
parent a9c8ccba
......@@ -25,7 +25,6 @@
#include <glib.h>
static char *used_metadata_names[] = {
NAUTILUS_METADATA_KEY_DEFAULT_VIEW,
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
......
......@@ -34,8 +34,6 @@
/* Per-file */
#define NAUTILUS_METADATA_KEY_DEFAULT_VIEW "nautilus-default-view"
#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "folder-background-color"
#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "folder-background-image"
......
......@@ -89,7 +89,6 @@ static struct {
const char *old_key;
const char *new_key;
} metadata_keys[] = {
{"default_component", "metadata::" NAUTILUS_METADATA_KEY_DEFAULT_VIEW},
{"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},
......
......@@ -838,17 +838,8 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
mimetype = nautilus_file_get_mime_type (file);
/* Look in metadata for view */
view_id = nautilus_file_get_metadata
(file, NAUTILUS_METADATA_KEY_DEFAULT_VIEW, NULL);
if (view_id != NULL &&
!nautilus_view_factory_view_supports_uri (view_id,
location,
nautilus_file_get_file_type (file),
mimetype)) {
g_free (view_id);
view_id = NULL;
}
/* Try to use the existing view */
view_id = g_strdup (nautilus_window_slot_get_content_view_id (slot));
/* Otherwise, use default */
if (view_id == NULL) {
......@@ -1713,7 +1704,6 @@ void
nautilus_window_slot_set_content_view (NautilusWindowSlot *slot,
const char *id)
{
NautilusFile *file;
char *uri;
g_assert (slot != NULL);
......@@ -1730,11 +1720,6 @@ nautilus_window_slot_set_content_view (NautilusWindowSlot *slot,
end_location_change (slot);
file = nautilus_file_get (slot->location);
nautilus_file_set_metadata
(file, NAUTILUS_METADATA_KEY_DEFAULT_VIEW, NULL, id);
nautilus_file_unref (file);
nautilus_window_slot_set_allow_stop (slot, TRUE);
if (nautilus_view_get_selection_count (slot->content_view) == 0) {
......
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