[nautilus] Remove next_pane functions from NautilusWindowInfo



commit dc26bef3e209d654c8f952ff4837beb34c0fa8ae
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Dec 16 10:52:07 2009 +0100

    Remove next_pane functions from NautilusWindowInfo
    
    No need for these, and they put FMDirectoryView at the wrong place.

 libnautilus-private/nautilus-window-info.c |   25 -------
 libnautilus-private/nautilus-window-info.h |   11 ---
 src/nautilus-window.c                      |   96 ++++-----------------------
 3 files changed, 15 insertions(+), 117 deletions(-)
---
diff --git a/libnautilus-private/nautilus-window-info.c b/libnautilus-private/nautilus-window-info.c
index 23cb812..efb45b5 100644
--- a/libnautilus-private/nautilus-window-info.c
+++ b/libnautilus-private/nautilus-window-info.c
@@ -261,23 +261,6 @@ nautilus_window_info_get_ui_manager (NautilusWindowInfo *window)
 	return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_ui_manager) (window);
 }
 
-gboolean
-nautilus_window_info_next_pane_is_writable (NautilusWindowInfo *window)
-{
-	g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), FALSE);
-	
-	return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->next_pane_is_writable) (window);
-}
-
-void
-nautilus_window_info_copy_move_selection_to_next_pane (NautilusWindowInfo *window,
-						       gboolean want_copy)
-{
-	g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
-	
-	(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->copy_move_selection_to_next_pane) (window, want_copy);
-}
-
 NautilusWindowSlotInfo *
 nautilus_window_info_get_active_slot (NautilusWindowInfo *window)
 {
@@ -293,11 +276,3 @@ nautilus_window_info_get_extra_slot (NautilusWindowInfo *window)
 
 	return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_extra_slot) (window);
 }
-
-struct FMDirectoryView *
-nautilus_window_info_get_directory_view_of_next_pane (NautilusWindowInfo *window)
-{
-	g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
-
-	return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_directory_view_of_next_pane) (window);	
-}
diff --git a/libnautilus-private/nautilus-window-info.h b/libnautilus-private/nautilus-window-info.h
index d3d347c..530f9d5 100644
--- a/libnautilus-private/nautilus-window-info.h
+++ b/libnautilus-private/nautilus-window-info.h
@@ -143,13 +143,6 @@ struct _NautilusWindowInfoIface
 					NautilusView *view);
 	void   (* close_window)       (NautilusWindowInfo *window);
 	GtkUIManager *     (* get_ui_manager)   (NautilusWindowInfo *window);
-
-	/* return TRUE if other pane is writable (files can be moved/copied
-	 * there), FALSE if it is not writable or no other pane exists */
-	gboolean (* next_pane_is_writable) (NautilusWindowInfo *window);
-	void (* copy_move_selection_to_next_pane) (NautilusWindowInfo *window,
-						   gboolean want_copy);
-	struct FMDirectoryView * (* get_directory_view_of_next_pane) (NautilusWindowInfo *window);
 };
 
 GType                             nautilus_window_info_get_type                 (void);
@@ -178,10 +171,6 @@ NautilusWindowShowHiddenFilesMode nautilus_window_info_get_hidden_files_mode
 void                              nautilus_window_info_set_hidden_files_mode    (NautilusWindowInfo                *window,
 										 NautilusWindowShowHiddenFilesMode  mode);
 GtkUIManager *                    nautilus_window_info_get_ui_manager           (NautilusWindowInfo                *window);
-gboolean                          nautilus_window_info_next_pane_is_writable    (NautilusWindowInfo                *window);
-void                              nautilus_window_info_copy_move_selection_to_next_pane (NautilusWindowInfo        *window,
-										 gboolean                   want_copy);
-struct FMDirectoryView *         nautilus_window_info_get_directory_view_of_next_pane (NautilusWindowInfo         *window);
 
 G_END_DECLS
 
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 91ed61e..924626b 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1539,73 +1539,26 @@ nautilus_window_get_ui_manager (NautilusWindow *window)
 NautilusWindowPane *
 nautilus_window_get_next_pane (NautilusWindow *window)
 {
-	NautilusWindowPane *next_pane;
-	GList *node;
-
-	/* return NULL if there is only one pane */
-	if (!window->details->panes || !window->details->panes->next) {
-		return NULL;
-	}
-	
-	/* get next pane in the (wrapped around) list */
-	node = g_list_find(window->details->panes, window->details->active_pane);
-	g_return_val_if_fail (node, FALSE);
-	if (node->next) {
-		next_pane = node->next->data;
-	}
-	else {
-		next_pane =  window->details->panes->data;
-	}
-	
-	return next_pane;
-}
-
-static gboolean
-nautilus_window_next_pane_is_writable (NautilusWindow *window)
-{
-	NautilusWindowPane *next_pane;
-	
-	g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), FALSE);
-	
-	/* check if there is just one pane */
-	if (!window->details->panes || !window->details->panes->next) {
-		return FALSE;
-	}
+       NautilusWindowPane *next_pane;
+       GList *node;
 
-	/* get next pane */
-	next_pane = nautilus_window_get_next_pane (window);
-	if(!next_pane) {
-		return FALSE;
-	}
+       /* return NULL if there is only one pane */
+       if (!window->details->panes || !window->details->panes->next) {
+	       return NULL;
+       }
 
-	if (next_pane->active_slot->content_view == NULL) {
-		return FALSE;
-	}
+       /* get next pane in the (wrapped around) list */
+       node = g_list_find (window->details->panes, window->details->active_pane);
+       g_return_val_if_fail (node, FALSE);
+       if (node->next) {
+	       next_pane = node->next->data;
+       } else {
+	       next_pane =  window->details->panes->data;
+       }
 
-	return !fm_directory_view_is_read_only (FM_DIRECTORY_VIEW (next_pane->active_slot->content_view));
+       return next_pane;
 }
 
-static void
-nautilus_window_copy_move_selection_to_next_pane (NautilusWindow *window,
-						  gboolean want_copy)
-{
-	NautilusWindowPane *source_pane, *target_pane;
-	FMDirectoryView *source, *target;
-
-	/* there must be more than one pane */
-	g_return_if_fail (window->details->panes && window->details->panes->next);
-
-	source_pane = NAUTILUS_WINDOW_PANE (window->details->active_pane);
-	target_pane = nautilus_window_get_next_pane(window);
-
-	g_return_if_fail (FM_IS_DIRECTORY_VIEW (source_pane->active_slot->content_view));
-	g_return_if_fail (FM_IS_DIRECTORY_VIEW (target_pane->active_slot->content_view));
-
-	source = FM_DIRECTORY_VIEW (source_pane->active_slot->content_view);
-	target = FM_DIRECTORY_VIEW (target_pane->active_slot->content_view);
-
-	fm_directory_view_move_copy_items_between_views (source, target, want_copy);
-}
 
 void
 nautilus_window_slot_set_viewed_file (NautilusWindowSlot *slot,
@@ -1963,22 +1916,6 @@ nautilus_window_get_extra_slot (NautilusWindow *window)
 	return extra_pane->active_slot;
 }
 
-static FMDirectoryView *
-nautilus_window_get_directory_view_of_next_pane (NautilusWindow *window)
-{
-	NautilusWindowPane *next_pane;
-	g_assert (NAUTILUS_IS_WINDOW (window));
-	
-	next_pane = nautilus_window_get_next_pane (window);
-	
-	if (next_pane && FM_IS_DIRECTORY_VIEW (next_pane->active_slot->content_view)) {
-		return FM_DIRECTORY_VIEW (next_pane->active_slot->content_view);
-	}
-	else {
-		return NULL;
-	}
-}
-
 GList *
 nautilus_window_get_slots (NautilusWindow *window)
 {
@@ -2010,15 +1947,12 @@ nautilus_window_info_iface_init (NautilusWindowInfoIface *iface)
 	iface->get_bookmark_list = nautilus_window_get_bookmark_list;
 	iface->get_current_location = nautilus_window_get_location_uri;
 	iface->get_ui_manager = nautilus_window_get_ui_manager;
-	iface->next_pane_is_writable = nautilus_window_next_pane_is_writable;
-	iface->copy_move_selection_to_next_pane = nautilus_window_copy_move_selection_to_next_pane;
 	iface->get_selection_count = nautilus_window_get_selection_count;
 	iface->get_selection = nautilus_window_get_selection;
 	iface->get_hidden_files_mode = nautilus_window_get_hidden_files_mode;
 	iface->set_hidden_files_mode = nautilus_window_set_hidden_files_mode;
 	iface->get_active_slot = nautilus_window_get_active_slot;
 	iface->get_extra_slot = nautilus_window_get_extra_slot;
-	iface->get_directory_view_of_next_pane = nautilus_window_get_directory_view_of_next_pane;
 }
 
 static void



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