diff options
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r-- | src/plugins/fs/search.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index a1c79784..44da2589 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -194,6 +194,23 @@ fs_search_result_received (SearchList * searchContext, | |||
194 | updateSearchSummary (searchContext); | 194 | updateSearchSummary (searchContext); |
195 | } | 195 | } |
196 | 196 | ||
197 | /** | ||
198 | * Update the applicability and availability rating | ||
199 | * for the given search result. | ||
200 | * | ||
201 | * @param info the search result (and metadata) | ||
202 | * @param availability_rank availability estimate | ||
203 | * @param applicability_rank relevance | ||
204 | */ | ||
205 | void fs_search_update (SearchList * searchContext, | ||
206 | const GNUNET_ECRS_FileInfo * info, | ||
207 | int availability_rank, | ||
208 | unsigned int applicability_rank) | ||
209 | { | ||
210 | /* FIXME */ | ||
211 | } | ||
212 | |||
213 | |||
197 | static int | 214 | static int |
198 | on_search_copy_uri_activate (void *cls, GtkWidget * searchEntry) | 215 | on_search_copy_uri_activate (void *cls, GtkWidget * searchEntry) |
199 | { | 216 | { |
@@ -389,7 +406,6 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
389 | SearchList *list; | 406 | SearchList *list; |
390 | gint pages; | 407 | gint pages; |
391 | char *description; | 408 | char *description; |
392 | const char *dhead; | ||
393 | GtkTreeViewColumn *column; | 409 | GtkTreeViewColumn *column; |
394 | GtkCellRenderer *renderer; | 410 | GtkCellRenderer *renderer; |
395 | GtkNotebook *notebook; | 411 | GtkNotebook *notebook; |
@@ -419,26 +435,18 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
419 | } | 435 | } |
420 | 436 | ||
421 | /* build new entry */ | 437 | /* build new entry */ |
422 | description = GNUNET_ECRS_uri_to_string (uri); | 438 | if (GNUNET_ECRS_uri_test_ksk(uri)) |
439 | description = GNUNET_ECRS_ksk_uri_to_human_readable_string (uri); | ||
440 | else | ||
441 | description = GNUNET_NS_sks_uri_to_human_readable_string (ectx, cfg, uri); | ||
423 | if (description == NULL) | 442 | if (description == NULL) |
424 | { | 443 | { |
425 | GNUNET_GE_BREAK (ectx, 0); | 444 | GNUNET_GE_BREAK (ectx, 0); |
426 | return NULL; | 445 | return NULL; |
427 | } | 446 | } |
428 | GNUNET_GE_ASSERT (ectx, | ||
429 | strlen (description) >= strlen (GNUNET_ECRS_URI_PREFIX)); | ||
430 | dhead = &description[strlen (GNUNET_ECRS_URI_PREFIX)]; | ||
431 | if (0 == | ||
432 | strncmp (dhead, GNUNET_ECRS_SEARCH_INFIX, | ||
433 | strlen (GNUNET_ECRS_SEARCH_INFIX))) | ||
434 | dhead = &dhead[strlen (GNUNET_ECRS_SEARCH_INFIX)]; | ||
435 | else if (0 == strncmp (dhead, | ||
436 | GNUNET_ECRS_SUBSPACE_INFIX, | ||
437 | strlen (GNUNET_ECRS_SUBSPACE_INFIX))) | ||
438 | dhead = &dhead[strlen (GNUNET_ECRS_SUBSPACE_INFIX)]; | ||
439 | list = GNUNET_malloc (sizeof (SearchList)); | 447 | list = GNUNET_malloc (sizeof (SearchList)); |
440 | memset (list, 0, sizeof (SearchList)); | 448 | memset (list, 0, sizeof (SearchList)); |
441 | list->searchString = GNUNET_strdup (dhead); | 449 | list->searchString = description; |
442 | list->uri = GNUNET_ECRS_uri_duplicate (uri); | 450 | list->uri = GNUNET_ECRS_uri_duplicate (uri); |
443 | list->fsui_list = fsui_list; | 451 | list->fsui_list = fsui_list; |
444 | list->next = search_head; | 452 | list->next = search_head; |
@@ -585,10 +593,9 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
585 | gtk_list_store_append (search_summary, &iter); | 593 | gtk_list_store_append (search_summary, &iter); |
586 | gtk_list_store_set (search_summary, | 594 | gtk_list_store_set (search_summary, |
587 | &iter, | 595 | &iter, |
588 | SEARCH_SUMMARY_NAME, dhead, | 596 | SEARCH_SUMMARY_NAME, description, |
589 | SEARCH_SUMMARY_RESULT_COUNT, 0, | 597 | SEARCH_SUMMARY_RESULT_COUNT, 0, |
590 | SEARCH_SUMMARY_INTERNAL, list, -1); | 598 | SEARCH_SUMMARY_INTERNAL, list, -1); |
591 | GNUNET_free (description); | ||
592 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (search_summary), &iter); | 599 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (search_summary), &iter); |
593 | list->summaryViewRowReference | 600 | list->summaryViewRowReference |
594 | = gtk_tree_row_reference_new (GTK_TREE_MODEL (search_summary), path); | 601 | = gtk_tree_row_reference_new (GTK_TREE_MODEL (search_summary), path); |