Commit f542674b authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks

guard against re-enterancy; hold refs on the sidebars.

2002-02-06  Michael Meeks  <michael@ximian.com>

	* src/nautilus-window-manage-views.c
	(load_new_location_in_sidebar_panels): guard
	against re-enterancy; hold refs on the sidebars.

	* src/file-manager/fm-directory-view.c
	(fm_directory_view_class_init): move re-entering
	auto preference registers to
	(fm_directory_view_init): here.
parent 61fe873c
2002-02-06 Michael Meeks <michael@ximian.com>
* src/nautilus-window-manage-views.c
(load_new_location_in_sidebar_panels): guard
against re-enterancy; hold refs on the sidebars.
* src/file-manager/fm-directory-view.c
(fm_directory_view_class_init): move re-entering
auto preference registers to
(fm_directory_view_init): here.
2002-02-05 Darin Adler <darin@bentspoon.com>
* components/tree/nautilus-tree-change-queue.c: Remove.
......
......@@ -1154,8 +1154,19 @@ add_scripts_directory (FMDirectoryView *view,
static void
fm_directory_view_init (FMDirectoryView *view)
{
static gboolean setup_autos = FALSE;
NautilusDirectory *scripts_directory;
if (!setup_autos) {
setup_autos = TRUE;
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
&confirm_trash_auto_value);
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_ENABLE_DELETE,
&show_delete_command_auto_value);
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
&use_new_window_auto_value);
}
view->details = g_new0 (FMDirectoryViewDetails, 1);
view->details->non_ready_files = g_hash_table_new (NULL, NULL);
......@@ -5800,11 +5811,4 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
copied_files_atom = gdk_atom_intern ("x-special/gnome-copied-files", FALSE);
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH,
&confirm_trash_auto_value);
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_ENABLE_DELETE,
&show_delete_command_auto_value);
eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_WINDOW_ALWAYS_NEW,
&use_new_window_auto_value);
}
......@@ -861,14 +861,21 @@ load_new_location_in_sidebar_panels (NautilusWindow *window,
GList *selection,
NautilusViewFrame *view_to_skip)
{
GList *sidebar_panels;
GList *l;
GList *node;
GList *sidebar_panels;
NautilusViewFrame *view;
/* Copy the list before traversing it, because during a failure in
* load_new..., list could be modified and bad things would happen
* also reference each object in case of re-enterency eg. window close.
*/
sidebar_panels = g_list_copy (window->sidebar_panels);
sidebar_panels = NULL;
for (l = window->sidebar_panels; l; l = l->next) {
sidebar_panels = g_list_prepend (sidebar_panels,
g_object_ref (l->data));
}
for (node = sidebar_panels; node != NULL; node = node->next) {
view = node->data;
if (view != view_to_skip
......@@ -876,6 +883,11 @@ load_new_location_in_sidebar_panels (NautilusWindow *window,
load_new_location_in_one_view (view, location, selection);
}
}
for (l = sidebar_panels; l; l = l->next) {
g_object_unref (l->data);
}
g_list_free (sidebar_panels);
}
......
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