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.c30
1 files changed, 18 insertions, 12 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 6e67db94..7e2df958 100644
--- a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
+++ b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
@@ -4,7 +4,7 @@
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -292,14 +292,17 @@ GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *
292 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort 292 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
293 */ 293 */
294static int 294static int
295add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseudonym, 295add_namespace_to_ts (void *cls,
296 const char *name, const char *unique_name, 296 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
297 const struct GNUNET_CONTAINER_MetaData *md, int rating) 297 const char *name,
298 const char *unique_name,
299 const struct GNUNET_CONTAINER_MetaData *md,
300 int rating)
298{ 301{
299 GtkTreeStore *ts = cls; 302 GtkTreeStore *ts = cls;
300 char *root; 303 char *root;
301 char *ns_name, *unique_ns_name; 304 char *ns_name, *unique_ns_name;
302 struct GNUNET_FS_PseudonymIdentifier *nsid; 305 struct GNUNET_CRYPTO_EccPublicKey *nsid;
303 char *description; 306 char *description;
304 int desc_is_a_dup; 307 int desc_is_a_dup;
305 char *uris; 308 char *uris;
@@ -311,11 +314,12 @@ add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseu
311 return GNUNET_OK; 314 return GNUNET_OK;
312 315
313 GNUNET_FS_pseudonym_get_info (GNUNET_FS_GTK_get_configuration (), 316 GNUNET_FS_pseudonym_get_info (GNUNET_FS_GTK_get_configuration (),
314 pseudonym, NULL, NULL, &ns_name, NULL); 317 pseudonym, NULL, NULL,
318 &ns_name, NULL);
315 unique_ns_name = GNUNET_FS_pseudonym_name_uniquify ( 319 unique_ns_name = GNUNET_FS_pseudonym_name_uniquify (
316 GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL); 320 GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL);
317 GNUNET_free (ns_name); 321 GNUNET_free (ns_name);
318 nsid = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymIdentifier)); 322 nsid = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey);
319 *nsid = *pseudonym; 323 *nsid = *pseudonym;
320 root = NULL; 324 root = NULL;
321 uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI); 325 uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI);
@@ -345,12 +349,14 @@ add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseu
345 return GNUNET_OK; 349 return GNUNET_OK;
346} 350}
347 351
352
348void 353void
349GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *main_ctx) 354GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *main_ctx)
350{ 355{
351 GtkTreeIter iter; 356 GtkTreeIter iter;
352 GtkTreePath *treepath; 357 GtkTreePath *treepath;
353 struct GNUNET_FS_PseudonymIdentifier *key = NULL, *selected_ns_id; 358 struct GNUNET_CRYPTO_EccPublicKey *key = NULL;
359 struct GNUNET_CRYPTO_EccPublicKey *selected_ns_id;
354 360
355 gboolean found = FALSE; 361 gboolean found = FALSE;
356 gchar *value = NULL; 362 gchar *value = NULL;
@@ -375,10 +381,10 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai
375 main_ctx->selected_ns_row = NULL; 381 main_ctx->selected_ns_row = NULL;
376 } 382 }
377 selected_ns_id = NULL; 383 selected_ns_id = NULL;
378 if (key != NULL) 384 if (NULL != key)
379 { 385 {
380 selected_ns_id = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymIdentifier)); 386 selected_ns_id = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey);
381 memcpy (selected_ns_id, key, sizeof (struct GNUNET_FS_PseudonymIdentifier)); 387 *selected_ns_id = *key;
382 } 388 }
383 389
384 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL ( 390 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (
@@ -427,7 +433,7 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai
427 -1); 433 -1);
428 if (selected_ns_id == NULL) 434 if (selected_ns_id == NULL)
429 found = TRUE; 435 found = TRUE;
430 else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct GNUNET_FS_PseudonymIdentifier)) == 0) 436 else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct GNUNET_CRYPTO_EccPublicKey)) == 0)
431 found = TRUE; 437 found = TRUE;
432 if (found || (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL ( 438 if (found || (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL (
433 main_ctx->search_ns_treestore), &iter))) 439 main_ctx->search_ns_treestore), &iter)))