[Xfce4-commits] <xfce4-settings:jeromeg/settings-editor> Directly insert the channel names in the list store.

Nick Schermer noreply at xfce.org
Tue Jan 19 19:18:01 CET 2010


Updating branch refs/heads/jeromeg/settings-editor
         to 1e6bc6f4f01ebea98fcff1a622c2b1b950bae5dc (commit)
       from a522ac62a9feedfdfca66f8de417168c3dfdb222 (commit)

commit 1e6bc6f4f01ebea98fcff1a622c2b1b950bae5dc
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jan 19 19:04:17 2010 +0100

    Directly insert the channel names in the list store.

 xfce4-settings-editor/main_window.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/xfce4-settings-editor/main_window.c b/xfce4-settings-editor/main_window.c
index 4f25dce..547fe55 100644
--- a/xfce4-settings-editor/main_window.c
+++ b/xfce4-settings-editor/main_window.c
@@ -223,26 +223,19 @@ static void
 load_channels (GtkListStore *store, GtkTreeView *treeview)
 {
     GtkTreeIter iter;
-    GValue value = {0,};
-
-    gchar **channel_names, **_channel_names_iter;
+    gchar **channel_names;
+    guint i;
+    GtkTreeSelection *selection;
 
     channel_names = xfconf_list_channels();
     if (channel_names != NULL)
     {
-        GtkTreeSelection *selection;
-
-        _channel_names_iter = channel_names;
-        while (*_channel_names_iter)
+        for (i = 0; channel_names[i] != NULL; i++)
         {
-            gtk_list_store_append (store, &iter);
-            g_value_init (&value, G_TYPE_STRING);
-            g_value_set_string (&value, *_channel_names_iter);
-            gtk_list_store_set_value (store, &iter, 0, &value);
-            g_value_unset (&value);
-
-            _channel_names_iter++;
+            gtk_list_store_insert_with_values (store, NULL, i,
+                                               0, channel_names[i], -1);
         }
+
         g_strfreev (channel_names);
 
         selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));



More information about the Xfce4-commits mailing list