aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-31 20:08:33 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-31 20:08:33 +0000
commitba18025a7e9adec8fed1f91fb4afd718248bde50 (patch)
tree8d56345b201a07cf48ba0b35a2810d899e7d9965
parentf4e8e43e42e24df4e0e4509cfeace45a5fb804b2 (diff)
downloadgnunet-gtk-ba18025a7e9adec8fed1f91fb4afd718248bde50.tar.gz
gnunet-gtk-ba18025a7e9adec8fed1f91fb4afd718248bde50.zip
-fix adding of duplicate entries for directories to the result set
-rw-r--r--src/fs/gnunet-fs-gtk-event_handler.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk-event_handler.c b/src/fs/gnunet-fs-gtk-event_handler.c
index 46ab20ea..d7f3d93a 100644
--- a/src/fs/gnunet-fs-gtk-event_handler.c
+++ b/src/fs/gnunet-fs-gtk-event_handler.c
@@ -186,9 +186,15 @@ stop_download (struct DownloadEntry *de, int is_suspend)
186 186
187 187
188 188
189/**
190 * Closure for 'add_directory_entry'.
191 */
189struct AddDirectoryEntryContext 192struct AddDirectoryEntryContext
190{ 193{
191 194
195 /**
196 *
197 */
192 struct DownloadEntry *de; 198 struct DownloadEntry *de;
193 199
194 /** 200 /**
@@ -196,6 +202,13 @@ struct AddDirectoryEntryContext
196 */ 202 */
197 GtkTreeRowReference *prr; 203 GtkTreeRowReference *prr;
198 204
205 /**
206 * Do we need to check if the given entry already exists to
207 * avoid adding it twice? Set to YES if 'add_directory_entry'
208 * is called upon directory completion (so we might see all
209 * entries again) and to NO if this is the initial download
210 * and we're calling during a 'PROGRESS' event.
211 */
199 int check_duplicates; 212 int check_duplicates;
200 213
201}; 214};
@@ -339,7 +352,7 @@ mark_download_completed (struct DownloadEntry *de, uint64_t size,
339 { 352 {
340 ade.de = de; 353 ade.de = de;
341 ade.prr = de->rr; 354 ade.prr = de->rr;
342 ade.check_duplicates = GNUNET_NO; 355 ade.check_duplicates = GNUNET_YES;
343 GNUNET_FS_GTK_mmap_and_scan (filename, &add_directory_entry, &ade); 356 GNUNET_FS_GTK_mmap_and_scan (filename, &add_directory_entry, &ade);
344 } 357 }
345 (void) change_download_colour (de, "green"); 358 (void) change_download_colour (de, "green");