aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c')
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
index cb5dc461..818caa6c 100644
--- a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
+++ b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
@@ -322,11 +322,12 @@ GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *
322 */ 322 */
323static int 323static int
324add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym, 324add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym,
325 const char *name, const char *unique_name,
325 const struct GNUNET_CONTAINER_MetaData *md, int rating) 326 const struct GNUNET_CONTAINER_MetaData *md, int rating)
326{ 327{
327 GtkTreeStore *ts = cls; 328 GtkTreeStore *ts = cls;
328 char *root; 329 char *root;
329 char *ns_name; 330 char *ns_name, *unique_ns_name;
330 GNUNET_HashCode *nsid; 331 GNUNET_HashCode *nsid;
331 char *description; 332 char *description;
332 int desc_is_a_dup; 333 int desc_is_a_dup;
@@ -335,9 +336,14 @@ add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym,
335 struct GNUNET_FS_Uri *uri; 336 struct GNUNET_FS_Uri *uri;
336 GtkTreeIter iter; 337 GtkTreeIter iter;
337 338
338 ns_name = 339 if (rating < 0)
339 GNUNET_PSEUDONYM_id_to_name (GNUNET_FS_GTK_get_configuration (), 340 return GNUNET_OK;
340 pseudonym); 341
342 GNUNET_PSEUDONYM_get_info (GNUNET_FS_GTK_get_configuration (),
343 pseudonym, NULL, NULL, &ns_name, NULL);
344 unique_ns_name = GNUNET_PSEUDONYM_name_uniquify (
345 GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL);
346 GNUNET_free (ns_name);
341 nsid = GNUNET_malloc (sizeof (GNUNET_HashCode)); 347 nsid = GNUNET_malloc (sizeof (GNUNET_HashCode));
342 *nsid = *pseudonym; 348 *nsid = *pseudonym;
343 root = NULL; 349 root = NULL;
@@ -352,13 +358,13 @@ add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym,
352 GNUNET_FS_uri_destroy (uri); 358 GNUNET_FS_uri_destroy (uri);
353 } 359 }
354 description = GNUNET_FS_GTK_get_description_from_metadata (md, &desc_is_a_dup); 360 description = GNUNET_FS_GTK_get_description_from_metadata (md, &desc_is_a_dup);
355 gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 361 gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT,
356 0, ns_name, 362 0, unique_ns_name,
357 1, nsid, 363 1, nsid,
358 2, root, 364 2, root,
359 3, description, 365 3, description,
360 -1); 366 -1);
361 GNUNET_free (ns_name); 367 GNUNET_free (unique_ns_name);
362 GNUNET_free_non_null (root); 368 GNUNET_free_non_null (root);
363 GNUNET_free (description); 369 GNUNET_free (description);
364 return GNUNET_OK; 370 return GNUNET_OK;