diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-event_handler.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-event_handler.c | 15 |
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 | */ | ||
189 | struct AddDirectoryEntryContext | 192 | struct 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"); |