diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_event-handler.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_event-handler.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c index 56bbbcb4..d5b4a9ad 100644 --- a/src/fs/gnunet-fs-gtk_event-handler.c +++ b/src/fs/gnunet-fs-gtk_event-handler.c | |||
@@ -499,8 +499,8 @@ get_suggested_filename_anonymity (GtkTreeModel *tm, | |||
499 | return NULL; | 499 | return NULL; |
500 | } | 500 | } |
501 | 501 | ||
502 | /* | 502 | |
503 | * | 503 | /** |
504 | * finished_chain - non-NULL for top-level call (for the item we're about to download), NULL otherwise | 504 | * finished_chain - non-NULL for top-level call (for the item we're about to download), NULL otherwise |
505 | * function sets it to GNUNET_YES if the item we're about to download was, in fact, already downloaded once, and thus we provide a name for it, | 505 | * function sets it to GNUNET_YES if the item we're about to download was, in fact, already downloaded once, and thus we provide a name for it, |
506 | * returning a finished relative filename that might only need .gnd appended to it, nothing else. | 506 | * returning a finished relative filename that might only need .gnd appended to it, nothing else. |
@@ -510,24 +510,24 @@ get_suggested_filename_anonymity (GtkTreeModel *tm, | |||
510 | * anonymity - anonymity level of one of the *parents. Initialize to -1. If none were downloaded, remains -1. | 510 | * anonymity - anonymity level of one of the *parents. Initialize to -1. If none were downloaded, remains -1. |
511 | * Returned strings should be freed with GNUNET_free() if not NULL. | 511 | * Returned strings should be freed with GNUNET_free() if not NULL. |
512 | */ | 512 | */ |
513 | void | 513 | static void |
514 | build_relative_name (GtkTreeModel *tm, | 514 | build_relative_name (GtkTreeModel *tm, |
515 | GtkTreeIter *iter, | 515 | GtkTreeIter *iter, |
516 | int *finished_chain, | 516 | int *finished_chain, |
517 | gchar **root_directory, | 517 | gchar **root_directory, |
518 | gchar **relative_directory, | 518 | gchar **relative_directory, |
519 | int *anonymity) | 519 | int *anonymity) |
520 | { | 520 | { |
521 | char *filename; | 521 | char *filename; |
522 | int downloaded_anonymity; | 522 | int downloaded_anonymity; |
523 | char *parent_filename; | ||
524 | GtkTreeIter parent; | 523 | GtkTreeIter parent; |
525 | 524 | ||
526 | gtk_tree_model_get (tm, iter, | 525 | gtk_tree_model_get (tm, iter, |
527 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, &filename, | 526 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, &filename, |
528 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, &downloaded_anonymity, -1); | 527 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, &downloaded_anonymity, |
528 | -1); | ||
529 | 529 | ||
530 | if (!gtk_tree_model_iter_parent (tm, &parent, iter)) | 530 | if (! gtk_tree_model_iter_parent (tm, &parent, iter)) |
531 | { | 531 | { |
532 | /* Ok, we're at the top item. | 532 | /* Ok, we're at the top item. |
533 | * bottom == GNUNET_YES is a corner case when we only have one | 533 | * bottom == GNUNET_YES is a corner case when we only have one |
@@ -624,6 +624,7 @@ build_relative_name (GtkTreeModel *tm, | |||
624 | g_free (filename); | 624 | g_free (filename); |
625 | } | 625 | } |
626 | 626 | ||
627 | |||
627 | static char * | 628 | static char * |
628 | get_suggested_filename_anonymity2 (GtkTreeModel *tm, | 629 | get_suggested_filename_anonymity2 (GtkTreeModel *tm, |
629 | GtkTreeIter *iter, | 630 | GtkTreeIter *iter, |
@@ -637,8 +638,6 @@ get_suggested_filename_anonymity2 (GtkTreeModel *tm, | |||
637 | char *tmp; | 638 | char *tmp; |
638 | int downloaded_anonymity; | 639 | int downloaded_anonymity; |
639 | struct GNUNET_CONTAINER_MetaData *meta; | 640 | struct GNUNET_CONTAINER_MetaData *meta; |
640 | GtkTreeIter parent; | ||
641 | char *dot; | ||
642 | size_t tmplen; | 641 | size_t tmplen; |
643 | int finished_chain; | 642 | int finished_chain; |
644 | 643 | ||
@@ -946,7 +945,20 @@ start_download_ctx_menu_helper (struct SearchListPopupContext *spc, | |||
946 | gtk_tree_path_free (path); | 945 | gtk_tree_path_free (path); |
947 | } | 946 | } |
948 | 947 | ||
948 | |||
949 | /** | ||
950 | * Selected row has changed in search result tree view, update preview | ||
951 | * and metadata areas. | ||
952 | * | ||
953 | * @param tv the tree view in a search tab where the selection changed | ||
954 | * @param user_data the 'struct SearchTab' that contains the tree view | ||
955 | */ | ||
949 | void | 956 | void |
957 | GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, | ||
958 | gpointer user_data); | ||
959 | |||
960 | |||
961 | static void | ||
950 | start_download2 () | 962 | start_download2 () |
951 | { | 963 | { |
952 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); | 964 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); |
@@ -1023,6 +1035,7 @@ start_download2 () | |||
1023 | GNUNET_FS_GTK_search_treeview_cursor_changed (tv, st); | 1035 | GNUNET_FS_GTK_search_treeview_cursor_changed (tv, st); |
1024 | } | 1036 | } |
1025 | 1037 | ||
1038 | |||
1026 | /** | 1039 | /** |
1027 | * User clicked on "Download!" button at the download options panel. | 1040 | * User clicked on "Download!" button at the download options panel. |
1028 | * | 1041 | * |
@@ -1748,7 +1761,6 @@ GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, | |||
1748 | GdkPixbuf *pixbuf; | 1761 | GdkPixbuf *pixbuf; |
1749 | struct SearchResult *sr; | 1762 | struct SearchResult *sr; |
1750 | struct GNUNET_FS_Uri *uri; | 1763 | struct GNUNET_FS_Uri *uri; |
1751 | gchar *filename; | ||
1752 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); | 1764 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); |
1753 | 1765 | ||
1754 | GNUNET_assert (tab->query_txt != NULL); | 1766 | GNUNET_assert (tab->query_txt != NULL); |