[gnome-commander] Fixed compiler warning 'GValueArray* ... is deprecated'
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Fixed compiler warning 'GValueArray* ... is deprecated'
- Date: Fri, 3 Apr 2015 19:32:14 +0000 (UTC)
commit a7e434e6090bb19471058241dbcc1d5236e58f79
Author: Uwe Scholz <uwescholz src gnome org>
Date: Fri Apr 3 19:01:25 2015 +0200
Fixed compiler warning 'GValueArray* ... is deprecated'
src/gnome-cmd-about-plugin.cc | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-cmd-about-plugin.cc b/src/gnome-cmd-about-plugin.cc
index 69a5739..fb1eaa1 100644
--- a/src/gnome-cmd-about-plugin.cc
+++ b/src/gnome-cmd-about-plugin.cc
@@ -597,21 +597,15 @@ static void gnome_cmd_about_plugin_set_persons (GnomeCmdAboutPlugin *about, guin
static void set_value_array_from_list (GValue *value, GSList *list)
{
gint length = g_slist_length (list);
- GValueArray *array = g_value_array_new (length);
-
- GValue tmp_value = { 0 };
+ GArray *array = g_array_sized_new (FALSE, TRUE, sizeof(char*), length);
for (GSList *i = list; i; i = i->next)
{
- char *str = (char *) i->data;
-
- g_value_init (&tmp_value, G_TYPE_STRING);
- g_value_set_string (&tmp_value, str);
- g_value_array_append (array, &tmp_value);
+ g_array_append_val (array, i->data);
}
g_value_set_boxed (value, array);
- g_value_array_free (array);
+ g_array_free (array, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]