aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_common.c')
-rw-r--r--src/fs/gnunet-fs-gtk_common.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c
index bf118cad..f4be95d3 100644
--- a/src/fs/gnunet-fs-gtk_common.c
+++ b/src/fs/gnunet-fs-gtk_common.c
@@ -322,14 +322,14 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
322 GtkLabel *sel_namespace_label; 322 GtkLabel *sel_namespace_label;
323 GtkTreePath *treepath; 323 GtkTreePath *treepath;
324 GtkEntry *query_entry; 324 GtkEntry *query_entry;
325 struct GNUNET_FS_PseudonymIdentifier *nsid; 325 struct GNUNET_CRYPTO_EccPublicKey *nsid;
326 struct GNUNET_FS_PseudonymIdentifier want; 326 struct GNUNET_CRYPTO_EccPublicKey want;
327 327
328 if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri)) 328 if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
329 { 329 {
330 struct DownloadEntry *de; 330 struct DownloadEntry *de;
331 331
332 de = GNUNET_malloc (sizeof (struct DownloadEntry)); 332 de = GNUNET_new (struct DownloadEntry);
333 de->anonymity = anonymity_level; 333 de->anonymity = anonymity_level;
334 de->uri = GNUNET_FS_uri_dup (uri); 334 de->uri = GNUNET_FS_uri_dup (uri);
335 GNUNET_FS_GTK_open_download_as_dialog (de); 335 GNUNET_FS_GTK_open_download_as_dialog (de);
@@ -366,7 +366,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
366 while ( ( (NULL == nsid) || 366 while ( ( (NULL == nsid) ||
367 (0 != memcmp (nsid, 367 (0 != memcmp (nsid,
368 &want, 368 &want,
369 sizeof (struct GNUNET_FS_PseudonymIdentifier))) ) && 369 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) ) &&
370 (gtk_tree_model_iter_next (namespace_treestore, &iter)) ) 370 (gtk_tree_model_iter_next (namespace_treestore, &iter)) )
371 gtk_tree_model_get (namespace_treestore, &iter, 371 gtk_tree_model_get (namespace_treestore, &iter,
372 GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, 372 GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY,
@@ -375,7 +375,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
375 if ( (NULL == nsid) || 375 if ( (NULL == nsid) ||
376 (0 != memcmp (nsid, 376 (0 != memcmp (nsid,
377 &want, 377 &want,
378 sizeof (struct GNUNET_FS_PseudonymIdentifier))) ) 378 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) )
379 { 379 {
380 /* namespace unknown / not in list!? */ 380 /* namespace unknown / not in list!? */
381 GNUNET_break (0); 381 GNUNET_break (0);
@@ -448,16 +448,20 @@ static int largest_namespace_rating = INT_MIN;
448 */ 448 */
449static int 449static int
450find_largest_namespace_rating_iterator (void *cls, 450find_largest_namespace_rating_iterator (void *cls,
451 const struct GNUNET_FS_PseudonymIdentifier *pseudonym, const char *name, 451 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
452 const char *unique_name, 452 const char *name,
453 const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) 453 const char *unique_name,
454 const struct GNUNET_CONTAINER_MetaData *md,
455 int32_t rating)
454{ 456{
455 int *largest = cls; 457 int *largest = cls;
458
456 if (*largest < rating) 459 if (*largest < rating)
457 *largest = rating; 460 *largest = rating;
458 return GNUNET_OK; 461 return GNUNET_OK;
459} 462}
460 463
464
461/** 465/**
462 * Finds largest namespace rating. 466 * Finds largest namespace rating.
463 * Used to calculate a rating for newly discovered namespaces. 467 * Used to calculate a rating for newly discovered namespaces.
@@ -472,10 +476,12 @@ GNUNET_GTK_find_largest_namespace_rating ()
472 if (largest_namespace_rating != INT_MIN) 476 if (largest_namespace_rating != INT_MIN)
473 return largest_namespace_rating; 477 return largest_namespace_rating;
474 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (), 478 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (),
475 find_largest_namespace_rating_iterator, &largest_namespace_rating); 479 &find_largest_namespace_rating_iterator,
480 &largest_namespace_rating);
476 return largest_namespace_rating; 481 return largest_namespace_rating;
477} 482}
478 483
484
479/** 485/**
480 * Sets largest namespace rating. 486 * Sets largest namespace rating.
481 * Used to change cached largest namespace rating, when namespace list 487 * Used to change cached largest namespace rating, when namespace list
@@ -491,6 +497,7 @@ GNUNET_GTK_set_largest_namespace_rating (int new_value)
491 largest_namespace_rating = new_value; 497 largest_namespace_rating = new_value;
492} 498}
493 499
500
494/** 501/**
495 * Converts a GtkTreeRowReference to a GtkTreeIter. 502 * Converts a GtkTreeRowReference to a GtkTreeIter.
496 * 503 *