[nautilus-actions] Remove nact_iactions_list_free_items_list() function



commit ebd9fc41b174beecd602cc21984e58c6e68d06fb
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu Sep 17 00:37:35 2009 +0200

    Remove nact_iactions_list_free_items_list() function

 ChangeLog                     |    5 +++++
 src/nact/nact-iactions-list.c |   30 ++++++++++--------------------
 src/nact/nact-iactions-list.h |    1 -
 src/nact/nact-main-menubar.c  |   10 +++++-----
 src/nact/nact-main-window.c   |    2 +-
 5 files changed, 21 insertions(+), 27 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7a8a7e4..03c9dfa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,11 @@
 	* src/nact/nact-assistant.h: Renamed as base-assistant.h.
 	Define the BaseAssistant class.
 
+	* src/nact/nact-iactions-list.c:
+	* src/nact/nact-iactions-list.h:
+	Replace nact_iactions_list_free_items_list() with
+	na_object_free_items().
+
 	* src/nact/nact-imenubar.c: Renamed as nact-main-menubar.c.
 	* src/nact/nact-imenubar.h: Renamed as nact-main-menubar.h.
 	Remove the NactIMenubar interface.
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index 9e25d67..e24a6a6 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -87,9 +87,10 @@ static GType        register_type( void );
 static void         interface_base_init( NactIActionsListInterface *klass );
 static void         interface_base_finalize( NactIActionsListInterface *klass );
 
+static void         free_items_callback( NactIActionsList *instance, GSList *items );
+
 static void         display_label( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, NactIActionsList *instance );
 static void         extend_selection_to_childs( NactIActionsList *instance, GtkTreeView *treeview, GtkTreeModel *model, GtkTreeIter *parent );
-static void         free_items_flat_list_callback( NactIActionsList *instance, GSList *items );
 static GtkTreeView *get_actions_list_treeview( NactIActionsList *instance );
 static gboolean     get_item( NactTreeModel *model, GtkTreePath *path, NAObject *object, GSList **items );
 static gboolean     have_dnd_mode( NactIActionsList *instance );
@@ -172,7 +173,7 @@ interface_base_init( NactIActionsListInterface *klass )
 				IACTIONS_LIST_SIGNAL_SELECTION_CHANGED,
 				G_TYPE_OBJECT,
 				G_SIGNAL_RUN_CLEANUP,
-				G_CALLBACK( free_items_flat_list_callback ),
+				G_CALLBACK( free_items_callback ),
 				NULL,
 				NULL,
 				g_cclosure_marshal_VOID__POINTER,
@@ -197,7 +198,7 @@ interface_base_init( NactIActionsListInterface *klass )
 				IACTIONS_LIST_SIGNAL_ITEM_UPDATED,
 				G_TYPE_OBJECT,
 				G_SIGNAL_RUN_CLEANUP,
-				G_CALLBACK( free_items_flat_list_callback ),
+				G_CALLBACK( free_items_callback ),
 				NULL,
 				NULL,
 				g_cclosure_marshal_VOID__POINTER,
@@ -210,6 +211,12 @@ interface_base_init( NactIActionsListInterface *klass )
 }
 
 static void
+free_items_callback( NactIActionsList *instance, GSList *items )
+{
+	na_object_free_items( items );
+}
+
+static void
 interface_base_finalize( NactIActionsListInterface *klass )
 {
 	static const gchar *thisfn = "nact_iactions_list_interface_base_finalize";
@@ -450,16 +457,6 @@ nact_iactions_list_fill( NactIActionsList *instance, GSList *items )
 	select_first_row( instance );
 }
 
-GSList *
-nact_iactions_list_free_items_list( NactIActionsList *instance, GSList *items )
-{
-	g_return_val_if_fail( NACT_IS_IACTIONS_LIST( instance ), NULL );
-
-	free_items_flat_list_callback( instance, items );
-
-	return( NULL );
-}
-
 /**
  * nact_iactions_list_get_items_count:
  * @window: this #NactIActionsList instance.
@@ -1012,13 +1009,6 @@ extend_selection_to_childs( NactIActionsList *instance, GtkTreeView *treeview, G
 	}
 }
 
-static void
-free_items_flat_list_callback( NactIActionsList *instance, GSList *items )
-{
-	g_slist_foreach( items, ( GFunc ) g_object_unref, NULL );
-	g_slist_free( items );
-}
-
 static GtkTreeView *
 get_actions_list_treeview( NactIActionsList *instance )
 {
diff --git a/src/nact/nact-iactions-list.h b/src/nact/nact-iactions-list.h
index 3e4cdda..1493c65 100644
--- a/src/nact/nact-iactions-list.h
+++ b/src/nact/nact-iactions-list.h
@@ -78,7 +78,6 @@ void      nact_iactions_list_dispose( NactIActionsList *instance );
 
 GSList   *nact_iactions_list_delete_selection( NactIActionsList *instance, GtkTreePath **path );
 void      nact_iactions_list_fill( NactIActionsList *instance, GSList *items );
-GSList   *nact_iactions_list_free_items_list( NactIActionsList *instance, GSList *items );
 guint     nact_iactions_list_get_items_count( NactIActionsList *instance );
 GSList   *nact_iactions_list_get_items( NactIActionsList *instance );
 GSList   *nact_iactions_list_get_modified_items( NactIActionsList *instance );
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index 826ae35..8fa0dca 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -260,7 +260,7 @@ nact_main_menubar_refresh_actions_sensitivity( NactMainWindow *window )
 
 	selected = nact_iactions_list_get_selected_items( NACT_IACTIONS_LIST( window ));
 	count = g_slist_length( selected );
-	nact_iactions_list_free_items_list( NACT_IACTIONS_LIST( window ), selected );
+	na_object_free_items( selected );
 	refresh_actions_sensitivity_with_count( window, count );
 }
 
@@ -451,7 +451,7 @@ on_cut_activated( GtkAction *gtk_action, NactMainWindow *window )
 
 	items = nact_main_window_delete_selection( window );
 	nact_clipboard_set( items );
-	nact_iactions_list_free_items_list( NACT_IACTIONS_LIST( window ), items );
+	na_object_free_items( items );
 
 	/* the selection is modified before updating the clipboard, so we
 	 * need a manual refresh of actions sensitivity
@@ -469,7 +469,7 @@ on_copy_activated( GtkAction *gtk_action, NactMainWindow *window )
 
 	items = nact_iactions_list_get_selected_items( NACT_IACTIONS_LIST( window ));
 	nact_clipboard_set( items );
-	nact_iactions_list_free_items_list( NACT_IACTIONS_LIST( window ), items );
+	na_object_free_items( items );
 
 	/* selection is not even modified, so a manuel refresh is needed
 	 */
@@ -482,7 +482,7 @@ on_paste_activated( GtkAction *gtk_action, NactMainWindow *window )
 	GSList *items;
 
 	items = nact_clipboard_get();
-	nact_iactions_list_free_items_list( NACT_IACTIONS_LIST( window ), items );
+	nact_iactions_list_insert_items( NACT_IACTIONS_LIST( window ), items );
 
 	g_signal_emit_by_name( window, IACTIONS_LIST_SIGNAL_ITEM_UPDATED, NULL );
 }
@@ -502,7 +502,7 @@ on_delete_activated( GtkAction *gtk_action, NactMainWindow *window )
 	g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
 
 	items = nact_main_window_delete_selection( window );
-	nact_iactions_list_free_items_list( NACT_IACTIONS_LIST( window ), items );
+	na_object_free_items( items );
 
 	g_signal_emit_by_name( window, IACTIONS_LIST_SIGNAL_ITEM_UPDATED, NULL );
 }
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index 2d6e7a1..b05eab6 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -629,7 +629,7 @@ nact_main_window_get_modified_items_count( const NactMainWindow *window )
 
 	modified = nact_iactions_list_get_modified_items( NACT_IACTIONS_LIST( window ));
 	count_modified = g_slist_length( modified );
-	nact_iactions_list_free_items_list(NACT_IACTIONS_LIST( window ), modified );
+	na_object_free_items( modified );
 	g_debug( "%s: count_modified=%d", thisfn, count_modified );
 
 	return( count_deleted + count_modified );



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