diff options
Diffstat (limited to 'src/setup/gnunet-setup-options.c')
-rw-r--r-- | src/setup/gnunet-setup-options.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/setup/gnunet-setup-options.c b/src/setup/gnunet-setup-options.c index 46ce9dbb..c9b16350 100644 --- a/src/setup/gnunet-setup-options.c +++ b/src/setup/gnunet-setup-options.c | |||
@@ -640,12 +640,8 @@ load_string_list_store (const void *cls, const char *section, | |||
640 | if (ls == NULL) | 640 | if (ls == NULL) |
641 | return GNUNET_SYSERR; | 641 | return GNUNET_SYSERR; |
642 | t = GNUNET_strdup (value); | 642 | t = GNUNET_strdup (value); |
643 | w = strtok (t, " "); | 643 | for (w = strtok (t, " "); w != NULL; w = strtok (NULL, " ")) |
644 | while (w != NULL) | ||
645 | { | ||
646 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, w, 1, FALSE, -1); | 644 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, w, 1, FALSE, -1); |
647 | w = strtok (NULL, " "); | ||
648 | } | ||
649 | GNUNET_free (t); | 645 | GNUNET_free (t); |
650 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, "", 1, TRUE, -1); | 646 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, "", 1, TRUE, -1); |
651 | return GNUNET_OK; | 647 | return GNUNET_OK; |
@@ -683,15 +679,18 @@ save_string_list_store (const void *cls, const char *section, | |||
683 | do | 679 | do |
684 | { | 680 | { |
685 | gtk_tree_model_get (tm, &iter, 0, &val, -1); | 681 | gtk_tree_model_get (tm, &iter, 0, &val, -1); |
686 | if (value == NULL) | 682 | if (0 < strlen (val)) |
687 | { | 683 | { |
688 | value = GNUNET_strdup (val); | 684 | if (value == NULL) |
689 | } | 685 | { |
690 | else | 686 | value = GNUNET_strdup (val); |
691 | { | 687 | } |
692 | GNUNET_asprintf (&n, "%s %s", value, val); | 688 | else |
693 | GNUNET_free (value); | 689 | { |
694 | value = n; | 690 | GNUNET_asprintf (&n, "%s %s", value, val); |
691 | GNUNET_free (value); | ||
692 | value = n; | ||
693 | } | ||
695 | } | 694 | } |
696 | g_free (val); | 695 | g_free (val); |
697 | } | 696 | } |
@@ -1701,6 +1700,17 @@ const struct GNUNET_SETUP_OptionSpecification option_specifications[] = { | |||
1701 | NULL}, | 1700 | NULL}, |
1702 | 1701 | ||
1703 | { | 1702 | { |
1703 | "GNUNET_setup_hostlist_url_liststore", | ||
1704 | "row-deleted", | ||
1705 | "hostlist", | ||
1706 | "SERVERS", | ||
1707 | NULL, NULL, | ||
1708 | NULL, | ||
1709 | &save_string_list_store, NULL, | ||
1710 | NULL, NULL, | ||
1711 | NULL}, | ||
1712 | |||
1713 | { | ||
1704 | "GNUNET_setup_hostlist_url_treeview", | 1714 | "GNUNET_setup_hostlist_url_treeview", |
1705 | NULL, NULL, NULL, /* FIXME */ | 1715 | NULL, NULL, NULL, /* FIXME */ |
1706 | gettext_noop ("Known hostlist URLs"), | 1716 | gettext_noop ("Known hostlist URLs"), |