diff options
Diffstat (limited to 'src/fs_event_handler.c')
-rw-r--r-- | src/fs_event_handler.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/fs_event_handler.c b/src/fs_event_handler.c index 9091c43c..ee3ef70d 100644 --- a/src/fs_event_handler.c +++ b/src/fs_event_handler.c | |||
@@ -215,6 +215,10 @@ add_directory_entry (void *cls, | |||
215 | { | 215 | { |
216 | struct AddDirectoryEntryContext *ade = cls; | 216 | struct AddDirectoryEntryContext *ade = cls; |
217 | GtkTreeIter iter; | 217 | GtkTreeIter iter; |
218 | GtkTreeIter piter; | ||
219 | GtkTreePath *path; | ||
220 | GtkTreeModel *tm; | ||
221 | struct GNUNET_FS_Uri *xuri; | ||
218 | 222 | ||
219 | if (uri == NULL) | 223 | if (uri == NULL) |
220 | { | 224 | { |
@@ -224,8 +228,32 @@ add_directory_entry (void *cls, | |||
224 | } | 228 | } |
225 | if (ade->check_duplicates == GNUNET_YES) | 229 | if (ade->check_duplicates == GNUNET_YES) |
226 | { | 230 | { |
227 | /* FIXME: check if 'uri' is already in the tab... */ | 231 | path = gtk_tree_row_reference_get_path (ade->prr); |
228 | GNUNET_break (0); | 232 | tm = gtk_tree_row_reference_get_model (ade->prr); |
233 | if (TRUE != gtk_tree_model_get_iter (tm, | ||
234 | &piter, path)) | ||
235 | { | ||
236 | GNUNET_break (0); | ||
237 | gtk_tree_path_free (path); | ||
238 | return; | ||
239 | } | ||
240 | gtk_tree_path_free (path); | ||
241 | if (TRUE == gtk_tree_model_iter_children (tm, | ||
242 | &iter, | ||
243 | &piter)) | ||
244 | { | ||
245 | do | ||
246 | { | ||
247 | gtk_tree_model_get (tm, | ||
248 | &iter, | ||
249 | 1, &xuri, | ||
250 | -1); | ||
251 | if (GNUNET_YES == | ||
252 | GNUNET_FS_uri_test_equal (xuri, uri)) | ||
253 | return; /* already present */ | ||
254 | } | ||
255 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); | ||
256 | } | ||
229 | } | 257 | } |
230 | GNUNET_GTK_add_search_result (ade->de->tab, | 258 | GNUNET_GTK_add_search_result (ade->de->tab, |
231 | &iter, | 259 | &iter, |