[Xfce4-commits] <xfce4-settings:master> Directly insert the channel names in the list store.
Jérôme Guelfucci
noreply at xfce.org
Tue Jan 19 19:34:44 CET 2010
Updating branch refs/heads/master
to 488e9d48784fea4ea53b789baaf25e1c1a884702 (commit)
from 0fce12e74f7157fdb2a7f5bac53824be9f80c1db (commit)
commit 488e9d48784fea4ea53b789baaf25e1c1a884702
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