[nautilus/gnome-3-2] window: cleanup nautilus_window_close_pane()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-2] window: cleanup nautilus_window_close_pane()
- Date: Mon, 17 Oct 2011 21:12:12 +0000 (UTC)
commit db4302ed2f91eb719ba7478472607fbf5d614636
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Sep 29 01:11:39 2011 -0400
window: cleanup nautilus_window_close_pane()
src/nautilus-window-private.h | 3 ++-
src/nautilus-window.c | 25 +++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 539aa04..b44a312 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -176,7 +176,8 @@ void nautilus_window_remove_bookmarks_menu_items (Nautil
void nautilus_window_update_show_hide_menu_items (NautilusWindow *window);
/* window toolbar */
-void nautilus_window_close_pane (NautilusWindowPane *pane);
+void nautilus_window_close_pane (NautilusWindow *window,
+ NautilusWindowPane *pane);
void nautilus_window_update_split_view_actions_sensitivity (NautilusWindow *window);
#endif /* NAUTILUS_WINDOW_PRIVATE_H */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index b2aef34..2518e8d 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -701,6 +701,16 @@ free_stored_viewers (NautilusWindow *window)
}
static void
+destroy_panes_foreach (gpointer data,
+ gpointer user_data)
+{
+ NautilusWindowPane *pane = data;
+ NautilusWindow *window = user_data;
+
+ nautilus_window_close_pane (window, pane);
+}
+
+static void
nautilus_window_destroy (GtkWidget *object)
{
NautilusWindow *window;
@@ -713,7 +723,7 @@ nautilus_window_destroy (GtkWidget *object)
/* close all panes safely */
panes_copy = g_list_copy (window->details->panes);
- g_list_foreach (panes_copy, (GFunc) nautilus_window_close_pane, NULL);
+ g_list_foreach (panes_copy, (GFunc) destroy_panes_foreach, window);
g_list_free (panes_copy);
/* the panes list should now be empty */
@@ -883,13 +893,10 @@ nautilus_window_open_slot (NautilusWindowPane *pane,
}
void
-nautilus_window_close_pane (NautilusWindowPane *pane)
+nautilus_window_close_pane (NautilusWindow *window,
+ NautilusWindowPane *pane)
{
- NautilusWindow *window;
-
g_assert (NAUTILUS_IS_WINDOW_PANE (pane));
- g_assert (NAUTILUS_IS_WINDOW (pane->window));
- g_assert (g_list_find (pane->window->details->panes, pane) != NULL);
while (pane->slots != NULL) {
NautilusWindowSlot *slot = pane->slots->data;
@@ -897,10 +904,8 @@ nautilus_window_close_pane (NautilusWindowPane *pane)
nautilus_window_close_slot (slot);
}
- window = pane->window;
-
/* If the pane was active, set it to NULL. The caller is responsible
- * for setting a new active pane with nautilus_window_pane_switch_to()
+ * for setting a new active pane with nautilus_window_set_active_pane()
* if it wants to continue using the window. */
if (window->details->active_pane == pane) {
window->details->active_pane = NULL;
@@ -2186,7 +2191,7 @@ nautilus_window_split_view_off (NautilusWindow *window)
next = l->next;
pane = l->data;
if (pane != active_pane) {
- nautilus_window_close_pane (pane);
+ nautilus_window_close_pane (window, pane);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]