diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_publish-dialog.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_publish-dialog.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c index 9dd07700..fe00a328 100644 --- a/src/fs/gnunet-fs-gtk_publish-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-dialog.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2005, 2006, 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -414,27 +414,9 @@ create_dir_at_iter (struct MainPublishingDialogContext *ctx, | |||
414 | 414 | ||
415 | 415 | ||
416 | /** | 416 | /** |
417 | * Remove the given entry and all of its children from the tree store. | ||
418 | * | ||
419 | * @param ts tree store to edit | ||
420 | * @param root root of the subtree to remove | ||
421 | */ | ||
422 | static void | ||
423 | remove_old_entry (GtkTreeStore * ts, | ||
424 | GtkTreeIter * root) | ||
425 | { | ||
426 | GtkTreeIter child; | ||
427 | |||
428 | while (gtk_tree_model_iter_children (GTK_TREE_MODEL (ts), &child, root)) | ||
429 | remove_old_entry (ts, &child); | ||
430 | gtk_tree_store_remove (ts, root); | ||
431 | } | ||
432 | |||
433 | |||
434 | /** | ||
435 | * Copy an entry in the tree from the 'old' position to the 'new' | 417 | * Copy an entry in the tree from the 'old' position to the 'new' |
436 | * position. All of the fields are copied, plain pointers will be | 418 | * position. All of the fields are copied, plain pointers will be |
437 | * aliased (model will thus be inconsistent until 'remove_old_entry' | 419 | * aliased (model will thus be inconsistent until the subtree remover |
438 | * is called on the 'old' entry). | 420 | * is called on the 'old' entry). |
439 | * | 421 | * |
440 | * @param ctx main publishing context | 422 | * @param ctx main publishing context |
@@ -641,7 +623,7 @@ GNUNET_GTK_master_publish_dialog_right_button_clicked_cb (GtkWidget * dummy, | |||
641 | return; | 623 | return; |
642 | } | 624 | } |
643 | copy_entry (ctx, ctx->file_info_treemodel, &iter, &pos, GNUNET_YES); | 625 | copy_entry (ctx, ctx->file_info_treemodel, &iter, &pos, GNUNET_YES); |
644 | remove_old_entry (GTK_TREE_STORE (ctx->file_info_treemodel), &iter); | 626 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), &iter); |
645 | } | 627 | } |
646 | 628 | ||
647 | 629 | ||
@@ -860,11 +842,8 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
860 | } | 842 | } |
861 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, 5, &fip, -1); | 843 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, 5, &fip, -1); |
862 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); | 844 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); |
863 | /* FIXME-BUG: the call above frees the row references in the entire | 845 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), |
864 | subtree; however, with the 'remove' operation below we | 846 | &iter); |
865 | ONLY delete the top-level entry; we probably want to delete | ||
866 | the entire directory subtree here... */ | ||
867 | gtk_tree_store_remove (GTK_TREE_STORE (ctx->file_info_treemodel), &iter); | ||
868 | update_selectivity (ctx); | 847 | update_selectivity (ctx); |
869 | } | 848 | } |
870 | 849 | ||