[nautilus-actions] Fix string list to array conversion
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Fix string list to array conversion
- Date: Wed, 14 Apr 2010 20:15:27 +0000 (UTC)
commit c82bbe20e50e7084dfbde1d2723f409e1fcf1350
Author: Pierre Wieser <pwieser trychlos org>
Date: Thu Apr 1 20:24:32 2010 +0200
Fix string list to array conversion
ChangeLog | 3 +++
src/core/na-core-utils.c | 11 ++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 59b2d65..8aa737b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,9 @@
(nadp_desktop_file_get_file_type):
Do not emit a warning if Type is not found in the .desktop file.
+ * src/core/na-core-utils.c (na_core_utils_slist_to_array):
+ Fix built of array.
+
* src/io-desktop/nadp-keys.h:
Set back action (resp. menu) Type to Action (resp. Menu).
diff --git a/src/core/na-core-utils.c b/src/core/na-core-utils.c
index a2b3ee8..33fd3f5 100644
--- a/src/core/na-core-utils.c
+++ b/src/core/na-core-utils.c
@@ -397,11 +397,16 @@ na_core_utils_slist_remove_utf8( GSList *list, const gchar *str )
gchar **
na_core_utils_slist_to_array( GSList *slist )
{
+ GString *str;
+ GSList *is;
gchar **array;
- gchar *text;
- text = na_core_utils_slist_to_text( slist );
- array = g_strsplit( text, ";", -1 );
+ str = g_string_new( "" );
+ for( is = slist ; is ; is = is->next ){
+ g_string_append_printf( str, "%s;", ( const gchar * ) is->data );
+ }
+ array = g_strsplit( str->str, ";", -1 );
+ g_string_free( str, TRUE );
return( array );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]