aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_event-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_event-handler.c')
-rw-r--r--src/fs/gnunet-fs-gtk_event-handler.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c
index 52a12caa..ec1f60ad 100644
--- a/src/fs/gnunet-fs-gtk_event-handler.c
+++ b/src/fs/gnunet-fs-gtk_event-handler.c
@@ -246,6 +246,16 @@ struct PublishEntry
246 246
247 247
248/** 248/**
249 * Head of search results with a manually-activated probe.
250 */
251struct SearchResult *pl_head;
252
253/**
254 * Tail of search results with a manually-activated probe.
255 */
256struct SearchResult *pl_tail;
257
258/**
249 * Head of linked list of tabs for searches. 259 * Head of linked list of tabs for searches.
250 */ 260 */
251static struct SearchTab *search_tab_head; 261static struct SearchTab *search_tab_head;
@@ -1722,7 +1732,13 @@ move_downloads_in_subtree (GtkTreeModel *tm,
1722 GNUNET_CONTAINER_meta_data_destroy (meta); 1732 GNUNET_CONTAINER_meta_data_destroy (meta);
1723 gtk_tree_row_reference_free (sr->rr); 1733 gtk_tree_row_reference_free (sr->rr);
1724 if (NULL != sr->probe) 1734 if (NULL != sr->probe)
1735 {
1725 GNUNET_FS_probe_stop (sr->probe); 1736 GNUNET_FS_probe_stop (sr->probe);
1737 sr->probe = NULL;
1738 GNUNET_CONTAINER_DLL_remove (pl_head,
1739 pl_tail,
1740 sr);
1741 }
1726 GNUNET_free (sr); 1742 GNUNET_free (sr);
1727 /* get ready for removal of the tree */ 1743 /* get ready for removal of the tree */
1728 gtk_tree_store_set (GTK_TREE_STORE (tm), &child, 1744 gtk_tree_store_set (GTK_TREE_STORE (tm), &child,
@@ -1781,7 +1797,13 @@ free_search_result (struct SearchResult *sr)
1781 GNUNET_CONTAINER_meta_data_destroy (meta); 1797 GNUNET_CONTAINER_meta_data_destroy (meta);
1782 gtk_tree_row_reference_free (sr->rr); 1798 gtk_tree_row_reference_free (sr->rr);
1783 if (NULL != sr->probe) 1799 if (NULL != sr->probe)
1800 {
1784 GNUNET_FS_probe_stop (sr->probe); 1801 GNUNET_FS_probe_stop (sr->probe);
1802 sr->probe = NULL;
1803 GNUNET_CONTAINER_DLL_remove (pl_head,
1804 pl_tail,
1805 sr);
1806 }
1785 GNUNET_free (sr); 1807 GNUNET_free (sr);
1786 move_downloads_in_subtree (tm, &iter); 1808 move_downloads_in_subtree (tm, &iter);
1787 GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (tm), &iter); 1809 GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (tm), &iter);
@@ -2317,11 +2339,16 @@ GNUNET_GTK_add_search_result (struct SearchTab *tab,
2317 sr = GNUNET_new (struct SearchResult); 2339 sr = GNUNET_new (struct SearchResult);
2318 sr->result = result; 2340 sr->result = result;
2319 if (NULL == result) 2341 if (NULL == result)
2342 {
2320 sr->probe = GNUNET_FS_probe (GNUNET_FS_GTK_get_fs_handle (), 2343 sr->probe = GNUNET_FS_probe (GNUNET_FS_GTK_get_fs_handle (),
2321 uri, 2344 uri,
2322 meta, 2345 meta,
2323 sr, 2346 sr,
2324 anonymity); 2347 anonymity);
2348 GNUNET_CONTAINER_DLL_insert (pl_head,
2349 pl_tail,
2350 sr);
2351 }
2325 sr->tab = tab; 2352 sr->tab = tab;
2326 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2353 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2327 "Allocated a search result SR=%p\n", 2354 "Allocated a search result SR=%p\n",
@@ -3142,6 +3169,11 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde,
3142 download in the URI tab */ 3169 download in the URI tab */
3143 de->sr = GNUNET_GTK_add_to_uri_tab (anonymity, 3170 de->sr = GNUNET_GTK_add_to_uri_tab (anonymity,
3144 meta, uri); 3171 meta, uri);
3172 GNUNET_FS_probe_stop (de->sr->probe);
3173 de->sr->probe = NULL;
3174 GNUNET_CONTAINER_DLL_remove (pl_head,
3175 pl_tail,
3176 de->sr);
3145 de->sr->download = de; 3177 de->sr->download = de;
3146 path = gtk_tree_row_reference_get_path (de->sr->rr); 3178 path = gtk_tree_row_reference_get_path (de->sr->rr);
3147 if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path)) 3179 if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path))