[nautilus-actions] No more use deprecated NADataBoxed functions
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] No more use deprecated NADataBoxed functions
- Date: Mon, 14 Feb 2011 23:53:17 +0000 (UTC)
commit 5e14e669ce68d390913a6011e712fef09af53213
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Feb 14 23:35:28 2011 +0100
No more use deprecated NADataBoxed functions
ChangeLog | 12 +++++++++++-
src/core/na-factory-object.c | 20 ++++++++++----------
src/io-desktop/nadp-reader.c | 10 +++++-----
src/io-desktop/nadp-writer.c | 10 +++++-----
src/io-gconf/nagp-reader.c | 8 ++++----
src/io-gconf/nagp-writer.c | 10 +++++-----
src/io-xml/naxml-reader.c | 2 +-
src/io-xml/naxml-writer.c | 8 +++++---
8 files changed, 46 insertions(+), 34 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 99da540..534095d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
2011-02-14 Pierre Wieser <pwieser trychlos org>
+ No more use deprecated functions
+
+ * src/core/na-factory-object.c:
+ * src/io-desktop/nadp-reader.c:
+ * src/io-desktop/nadp-writer.c:
+ * src/io-gconf/nagp-reader.c:
+ * src/io-gconf/nagp-writer.c:
+ * src/io-xml/naxml-reader.c:
+ * src/io-xml/naxml-writer.c: Updated accordingly.
+
NADataBoxed class now derives from NABoxed
- * * src/api/na-boxed.h:
+ * src/api/na-boxed.h:
* src/api/na-data-boxed.h:
* src/api/na-data-types.h:
* src/core/na-boxed.c:
diff --git a/src/core/na-factory-object.c b/src/core/na-factory-object.c
index 70f186a..bae9cfc 100644
--- a/src/core/na-factory-object.c
+++ b/src/core/na-factory-object.c
@@ -333,7 +333,7 @@ set_defaults_iter( NADataDef *def, NafoDefaultIter *data )
if( !boxed ){
boxed = na_data_boxed_new( def );
attach_boxed_to_object( data->object, boxed );
- na_data_boxed_set_from_string( boxed, def->default_value );
+ na_boxed_set_from_string( NA_BOXED( boxed ), def->default_value );
}
/* do not stop */
@@ -406,7 +406,7 @@ na_factory_object_copy( NAIFactoryObject *target, const NAIFactoryObject *source
tgt_boxed = na_data_boxed_new( def );
attach_boxed_to_object( target, tgt_boxed );
}
- na_data_boxed_set_from_boxed( tgt_boxed, src_boxed );
+ na_boxed_set_from_boxed( NA_BOXED( tgt_boxed ), NA_BOXED( src_boxed ));
}
}
@@ -572,7 +572,7 @@ na_factory_object_dump( const NAIFactoryObject *object )
for( it = list ; it ; it = it->next ){
NADataBoxed *boxed = NA_DATA_BOXED( it->data );
const NADataDef *def = na_data_boxed_get_data_def( boxed );
- gchar *value = na_data_boxed_get_as_string( boxed );
+ gchar *value = na_boxed_get_string( NA_BOXED( boxed ));
g_debug( "| %s: %*s=%s", thisfn, length, def->name+l_prefix, value );
g_free( value );
}
@@ -647,7 +647,7 @@ read_data_iter( NADataDef *def, NafoReadIter *iter )
NADataBoxed *exist = na_ifactory_object_get_data_boxed( iter->object, def->name );
if( exist ){
- na_data_boxed_set_from_boxed( exist, boxed );
+ na_boxed_set_from_boxed( NA_BOXED( exist ), NA_BOXED( boxed ));
g_object_unref( boxed );
} else {
@@ -751,7 +751,7 @@ na_factory_object_get_as_value( const NAIFactoryObject *object, const gchar *nam
boxed = na_ifactory_object_get_data_boxed( object, name );
if( boxed ){
- na_data_boxed_get_as_value( boxed, value );
+ na_boxed_get_as_value( NA_BOXED( boxed ), value );
}
}
@@ -779,7 +779,7 @@ na_factory_object_get_as_void( const NAIFactoryObject *object, const gchar *name
boxed = na_ifactory_object_get_data_boxed( object, name );
if( boxed ){
- value = na_data_boxed_get_as_void( boxed );
+ value = na_boxed_get_as_void( NA_BOXED( boxed ));
}
return( value );
@@ -803,7 +803,7 @@ na_factory_object_set_from_value( NAIFactoryObject *object, const gchar *name, c
NADataBoxed *boxed = na_ifactory_object_get_data_boxed( object, name );
if( boxed ){
- na_data_boxed_set_from_value( boxed, value );
+ na_boxed_set_from_value( NA_BOXED( boxed ), value );
} else {
NADataDef *def = na_factory_object_get_data_def( object, name );
@@ -812,7 +812,7 @@ na_factory_object_set_from_value( NAIFactoryObject *object, const gchar *name, c
} else {
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_value( boxed, value );
+ na_boxed_set_from_value( NA_BOXED( boxed ), value );
attach_boxed_to_object( object, boxed );
}
}
@@ -835,7 +835,7 @@ na_factory_object_set_from_void( NAIFactoryObject *object, const gchar *name, co
NADataBoxed *boxed = na_ifactory_object_get_data_boxed( object, name );
if( boxed ){
- na_data_boxed_set_from_void( boxed, data );
+ na_boxed_set_from_void( NA_BOXED( boxed ), data );
} else {
NADataDef *def = na_factory_object_get_data_def( object, name );
@@ -844,7 +844,7 @@ na_factory_object_set_from_void( NAIFactoryObject *object, const gchar *name, co
} else {
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, data );
+ na_boxed_set_from_void( NA_BOXED( boxed ), data );
attach_boxed_to_object( object, boxed );
}
}
diff --git a/src/io-desktop/nadp-reader.c b/src/io-desktop/nadp-reader.c
index 8859ff4..f2406eb 100644
--- a/src/io-desktop/nadp-reader.c
+++ b/src/io-desktop/nadp-reader.c
@@ -523,7 +523,7 @@ nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void
str_value = nadp_desktop_file_get_locale_string( nrd->ndf, group, def->desktop_entry, &found, def->default_value );
if( found ){
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, str_value );
+ na_boxed_set_from_void( NA_BOXED( boxed ), str_value );
}
g_free( str_value );
break;
@@ -532,7 +532,7 @@ nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void
str_value = nadp_desktop_file_get_string( nrd->ndf, group, def->desktop_entry, &found, def->default_value );
if( found ){
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, str_value );
+ na_boxed_set_from_void( NA_BOXED( boxed ), str_value );
}
g_free( str_value );
break;
@@ -541,7 +541,7 @@ nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void
bool_value = nadp_desktop_file_get_boolean( nrd->ndf, group, def->desktop_entry, &found, na_core_utils_boolean_from_string( def->default_value ));
if( found ){
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, GUINT_TO_POINTER( bool_value ));
+ na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( bool_value ));
}
break;
@@ -549,7 +549,7 @@ nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void
slist_value = nadp_desktop_file_get_string_list( nrd->ndf, group, def->desktop_entry, &found, def->default_value );
if( found ){
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, slist_value );
+ na_boxed_set_from_void( NA_BOXED( boxed ), slist_value );
}
na_core_utils_slist_free( slist_value );
break;
@@ -558,7 +558,7 @@ nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void
uint_value = nadp_desktop_file_get_uint( nrd->ndf, group, def->desktop_entry, &found, atoi( def->default_value ));
if( found ){
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_void( boxed, GUINT_TO_POINTER( uint_value ));
+ na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( uint_value ));
}
break;
diff --git a/src/io-desktop/nadp-writer.c b/src/io-desktop/nadp-writer.c
index a460b84..8450e7e 100644
--- a/src/io-desktop/nadp-writer.c
+++ b/src/io-desktop/nadp-writer.c
@@ -515,7 +515,7 @@ nadp_writer_ifactory_provider_write_data(
switch( def->type ){
case NA_DATA_TYPE_STRING:
- str_value = na_data_boxed_get_as_string( boxed );
+ str_value = na_boxed_get_string( NA_BOXED( boxed ));
if( !strcmp( def->name, NAFO_DATA_PATH )){
parms = na_object_get_parameters( object );
@@ -530,24 +530,24 @@ nadp_writer_ifactory_provider_write_data(
break;
case NA_DATA_TYPE_LOCALE_STRING:
- str_value = na_data_boxed_get_as_string( boxed );
+ str_value = na_boxed_get_string( NA_BOXED( boxed ));
nadp_desktop_file_set_locale_string( ndf, group_name, def->desktop_entry, str_value );
g_free( str_value );
break;
case NA_DATA_TYPE_BOOLEAN:
- bool_value = GPOINTER_TO_UINT( na_data_boxed_get_as_void( boxed ));
+ bool_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed )));
nadp_desktop_file_set_boolean( ndf, group_name, def->desktop_entry, bool_value );
break;
case NA_DATA_TYPE_STRING_LIST:
- slist_value = ( GSList * ) na_data_boxed_get_as_void( boxed );
+ slist_value = ( GSList * ) na_boxed_get_as_void( NA_BOXED( boxed ));
nadp_desktop_file_set_string_list( ndf, group_name, def->desktop_entry, slist_value );
na_core_utils_slist_free( slist_value );
break;
case NA_DATA_TYPE_UINT:
- uint_value = GPOINTER_TO_UINT( na_data_boxed_get_as_void( boxed ));
+ uint_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed )));
nadp_desktop_file_set_uint( ndf, group_name, def->desktop_entry, uint_value );
break;
diff --git a/src/io-gconf/nagp-reader.c b/src/io-gconf/nagp-reader.c
index 4bbfa66..50e85cf 100644
--- a/src/io-gconf/nagp-reader.c
+++ b/src/io-gconf/nagp-reader.c
@@ -370,24 +370,24 @@ get_boxed_from_path( const NagpGConfProvider *provider, const gchar *path, Reade
case NA_DATA_TYPE_LOCALE_STRING:
str_value = na_gconf_utils_read_string( provider->private->gconf, entry_path, TRUE, NULL );
g_debug( "%s: entry=%s, value=%s", thisfn, def->gconf_entry, str_value );
- na_data_boxed_set_from_string( boxed, str_value );
+ na_boxed_set_from_string( NA_BOXED( boxed ), str_value );
g_free( str_value );
break;
case NA_DATA_TYPE_BOOLEAN:
bool_value = na_gconf_utils_read_bool( provider->private->gconf, entry_path, TRUE, FALSE );
- na_data_boxed_set_from_void( boxed, GUINT_TO_POINTER( bool_value ));
+ na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( bool_value ));
break;
case NA_DATA_TYPE_STRING_LIST:
slist_value = na_gconf_utils_read_string_list( provider->private->gconf, entry_path );
- na_data_boxed_set_from_void( boxed, slist_value );
+ na_boxed_set_from_void( NA_BOXED( boxed ), slist_value );
na_core_utils_slist_free( slist_value );
break;
case NA_DATA_TYPE_UINT:
int_value = na_gconf_utils_read_int( provider->private->gconf, entry_path, TRUE, 0 );
- na_data_boxed_set_from_void( boxed, GUINT_TO_POINTER( int_value ));
+ na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( int_value ));
break;
default:
diff --git a/src/io-gconf/nagp-writer.c b/src/io-gconf/nagp-writer.c
index 718c6ff..5dca9a1 100644
--- a/src/io-gconf/nagp-writer.c
+++ b/src/io-gconf/nagp-writer.c
@@ -313,7 +313,7 @@ nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data,
switch( def->type ){
case NA_DATA_TYPE_STRING:
- str_value = na_data_boxed_get_as_string( boxed );
+ str_value = na_boxed_get_string( NA_BOXED( boxed ));
na_gconf_utils_write_string( gconf, path, str_value, &msg );
if( msg ){
*messages = g_slist_append( *messages, msg );
@@ -323,7 +323,7 @@ nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data,
break;
case NA_DATA_TYPE_LOCALE_STRING:
- str_value = na_data_boxed_get_as_string( boxed );
+ str_value = na_boxed_get_string( NA_BOXED( boxed ));
na_gconf_utils_write_string( gconf, path, str_value, &msg );
if( msg ){
*messages = g_slist_append( *messages, msg );
@@ -333,7 +333,7 @@ nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data,
break;
case NA_DATA_TYPE_BOOLEAN:
- bool_value = GPOINTER_TO_UINT( na_data_boxed_get_as_void( boxed ));
+ bool_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed )));
na_gconf_utils_write_bool( gconf, path, bool_value, &msg );
if( msg ){
*messages = g_slist_append( *messages, msg );
@@ -342,7 +342,7 @@ nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data,
break;
case NA_DATA_TYPE_STRING_LIST:
- slist_value = ( GSList * ) na_data_boxed_get_as_void( boxed );
+ slist_value = ( GSList * ) na_boxed_get_as_void( NA_BOXED( boxed ));
na_gconf_utils_write_string_list( gconf, path, slist_value, &msg );
if( msg ){
*messages = g_slist_append( *messages, msg );
@@ -352,7 +352,7 @@ nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data,
break;
case NA_DATA_TYPE_UINT:
- uint_value = GPOINTER_TO_UINT( na_data_boxed_get_as_void( boxed ));
+ uint_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed )));
na_gconf_utils_write_int( gconf, path, uint_value, &msg );
if( msg ){
*messages = g_slist_append( *messages, msg );
diff --git a/src/io-xml/naxml-reader.c b/src/io-xml/naxml-reader.c
index 5865c03..59e890f 100644
--- a/src/io-xml/naxml-reader.c
+++ b/src/io-xml/naxml-reader.c
@@ -726,7 +726,7 @@ read_data_boxed_from_node( NAXMLReader *reader, xmlChar *path, xmlNode *parent,
if( reader->private->root_node_str->fn_get_value ){
value = ( *reader->private->root_node_str->fn_get_value )( reader, parent, def );
boxed = na_data_boxed_new( def );
- na_data_boxed_set_from_string( boxed, value );
+ na_boxed_set_from_string( NA_BOXED( boxed ), value );
g_free( value );
}
}
diff --git a/src/io-xml/naxml-writer.c b/src/io-xml/naxml-writer.c
index bee67c1..a23374c 100644
--- a/src/io-xml/naxml-writer.c
+++ b/src/io-xml/naxml-writer.c
@@ -521,7 +521,7 @@ write_data_schema_v2( NAXMLWriter *writer, const NAObjectId *object, const NADat
gchar *object_id;
gchar *value_str;
- value_str = na_data_boxed_get_as_string( boxed );
+ value_str = na_boxed_get_string( NA_BOXED( boxed ));
/* boolean value must be lowercase
*/
@@ -623,7 +623,7 @@ write_data_dump( NAXMLWriter *writer, const NAObjectId *object, const NADataBoxe
gchar *entry;
gchar *value_str;
- value_str = na_data_boxed_get_as_string( boxed );
+ value_str = na_boxed_get_string( NA_BOXED( boxed ));
/* boolean value must be lowercase
*/
@@ -666,7 +666,7 @@ write_data_dump_element( NAXMLWriter *writer, const NADataDef *def, const NAData
value_list_node = xmlNewChild( value_node, NULL, BAD_CAST( NAXML_KEY_DUMP_NODE_VALUE_LIST ), NULL );
xmlNewProp( value_list_node, BAD_CAST( NAXML_KEY_DUMP_NODE_VALUE_LIST_PARM_TYPE ), BAD_CAST( NAXML_KEY_DUMP_NODE_VALUE_TYPE_STRING ));
value_list_value_node = xmlNewChild( value_list_node, NULL, BAD_CAST( NAXML_KEY_DUMP_NODE_VALUE ), NULL );
- list = ( GSList * ) na_data_boxed_get_as_void( boxed );
+ list = ( GSList * ) na_boxed_get_as_void( NA_BOXED( boxed ));
for( is = list ; is ; is = is->next ){
encoded_content = xmlEncodeSpecialChars( writer->private->doc, BAD_CAST(( gchar * ) is->data ));
@@ -674,6 +674,8 @@ write_data_dump_element( NAXMLWriter *writer, const NADataDef *def, const NAData
xmlFree( encoded_content );
}
+ na_core_utils_slist_free( list );
+
} else {
encoded_content = xmlEncodeSpecialChars( writer->private->doc, BAD_CAST( value_str ));
xmlNewChild( value_node, NULL, BAD_CAST( na_data_types_get_gconf_dump_key( def->type )), encoded_content );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]