[nautilus-actions] na_object_item_factory_write_start function is renamed as na_object_item_rebuild_children_slist()
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] na_object_item_factory_write_start function is renamed as na_object_item_rebuild_children_slist()
- Date: Tue, 27 Jul 2010 21:46:42 +0000 (UTC)
commit 2dee03eed66f68c27e75570e19d1de3d58f348d7
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Jul 19 06:35:25 2010 +0200
na_object_item_factory_write_start function is renamed as na_object_item_rebuild_children_slist()
There was no sense to use a IFactory name in NAObjectItem class as this later does not have
any knowledge of IFactory interfaces.
ChangeLog | 9 +++++++
src/api/na-object-item.h | 2 +-
src/core/na-object-action.c | 2 +-
src/core/na-object-item.c | 52 +++++++++++++++++++------------------------
src/core/na-object-menu.c | 2 +-
5 files changed, 35 insertions(+), 32 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0021189..074a280 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-19 Pierre Wieser <pwieser trychlos org>
+
+ * src/api/na-object-item.h:
+ * src/core/na-object-item.c (na_object_item_factory_write_start):
+ Function is renamed as na_object_item_rebuild_children_slist().
+
+ * src/core/na-object-action.c:
+ * src/core/na-object-menu.c: Updated accordingly.
+
2010-07-05 Pierre Wieser <pwieser trychlos org>
* src/nact/nact-icommand-tab.c (nact_icommand_tab_runtime_init_toplevel):
diff --git a/src/api/na-object-item.h b/src/api/na-object-item.h
index 1d72fb1..1a365c4 100644
--- a/src/api/na-object-item.h
+++ b/src/api/na-object-item.h
@@ -92,7 +92,7 @@ void na_object_item_count_items( GList *items, gint *menus, gint *actions
void na_object_item_unref_items( GList *items );
void na_object_item_unref_items_rec( GList *items );
-void na_object_item_factory_write_start( NAObjectItem *item );
+void na_object_item_rebuild_children_slist( NAObjectItem *item );
G_END_DECLS
diff --git a/src/core/na-object-action.c b/src/core/na-object-action.c
index efcf0ac..026830e 100644
--- a/src/core/na-object-action.c
+++ b/src/core/na-object-action.c
@@ -364,7 +364,7 @@ ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider
static guint
ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
- na_object_item_factory_write_start( NA_OBJECT_ITEM( instance ));
+ na_object_item_rebuild_children_slist( NA_OBJECT_ITEM( instance ));
return( NA_IIO_PROVIDER_CODE_OK );
}
diff --git a/src/core/na-object-item.c b/src/core/na-object-item.c
index 534d08a..c89e06e 100644
--- a/src/core/na-object-item.c
+++ b/src/core/na-object-item.c
@@ -74,7 +74,6 @@ static void object_copy( NAObject*target, const NAObject *source, gboolean rec
static gchar *object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent );
static void copy_children( NAObjectItem *target, const NAObjectItem *source );
-static void rebuild_children_slist( NAObjectItem *item );
GType
na_object_item_get_type( void )
@@ -697,15 +696,35 @@ na_object_item_unref_items_rec( GList *items )
}
/**
- * na_object_item_factory_write_start:
+ * na_object_item_rebuild_children_slist:
* @item: this #NAObjectItem-derived object.
*
* Rebuild the string list of children.
*/
void
-na_object_item_factory_write_start( NAObjectItem *item )
+na_object_item_rebuild_children_slist( NAObjectItem *item )
{
- rebuild_children_slist( item );
+ GSList *slist;
+ GList *subitems, *it;
+ gchar *id;
+
+ na_object_set_items_slist( item, NULL );
+
+ if( !item->private->dispose_has_run ){
+
+ subitems = na_object_get_items( item );
+ slist = NULL;
+
+ for( it = subitems ; it ; it = it->next ){
+ id = na_object_get_id( it->data );
+ slist = g_slist_prepend( slist, id );
+ }
+ slist = g_slist_reverse( slist );
+
+ na_object_set_items_slist( item, slist );
+
+ na_core_utils_slist_free( slist );
+ }
}
static void
@@ -733,28 +752,3 @@ copy_children( NAObjectItem *target, const NAObjectItem *source )
tgt_children = g_list_reverse( tgt_children );
na_object_set_items( target, tgt_children );
}
-
-static void
-rebuild_children_slist( NAObjectItem *item )
-{
- GSList *slist;
- GList *subitems, *it;
- gchar *id;
-
- slist = NULL;
-
- if( !item->private->dispose_has_run ){
-
- subitems = na_object_get_items( item );
-
- for( it = subitems ; it ; it = it->next ){
- id = na_object_get_id( it->data );
- slist = g_slist_prepend( slist, id );
- }
- slist = g_slist_reverse( slist );
-
- na_object_set_items_slist( item, slist );
-
- na_core_utils_slist_free( slist );
- }
-}
diff --git a/src/core/na-object-menu.c b/src/core/na-object-menu.c
index 0c6858b..a482627 100644
--- a/src/core/na-object-menu.c
+++ b/src/core/na-object-menu.c
@@ -338,7 +338,7 @@ ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider
static guint
ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages )
{
- na_object_item_factory_write_start( NA_OBJECT_ITEM( instance ));
+ na_object_item_rebuild_children_slist( NA_OBJECT_ITEM( instance ));
return( NA_IIO_PROVIDER_CODE_OK );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]