From 49f29dd99d3f331aecabced77ec12f0e5749d2f9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 2 Feb 2012 20:18:06 +0000 Subject: -resolving more FIXMEs --- src/fs/gnunet-fs-gtk.c | 4 +-- src/fs/gnunet-fs-gtk_advertise-pseudonym.c | 2 +- src/fs/gnunet-fs-gtk_publish-dialog.c | 58 ++++++++++-------------------- 3 files changed, 21 insertions(+), 43 deletions(-) diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index bbc8f58d..0d26001c 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c @@ -94,7 +94,7 @@ GNUNET_FS_GTK_get_anonymity_level_list_store () /** * Task run on shutdown. - * FIXME: does this need to be a separate task!? + * FIXME-STYLE: does this need to be a separate task!? * * @param cls NULL * @param tc scheduler context, unused @@ -150,7 +150,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ("GNUNET_GTK_main_window")); gtk_window_maximize (GTK_WINDOW (main_window)); - /* Allow multiple selection in metadata view; FIXME: can we do this with glade now? */ + /* Allow multiple selection in metadata view; FIXME-STYLE: can we do this with glade now? */ metadata_tree = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window_metadata_treeview")); diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c index f6714010..87777618 100644 --- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c +++ b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c @@ -313,7 +313,7 @@ GNUNET_GTK_main_menu_file_advertise_pseudonym_activate_cb (GtkWidget * dummy, &add_to_list, ls); - /* FIXME: this signal can be connected by (modern) Glade automatically */ + /* FIXME-UNCLEAN: this signal can be connected by (modern) Glade automatically */ tv = GTK_TREE_VIEW (gtk_builder_get_object (builder, "GNUNET_GTK_select_pseudonym_tree_view")); sel = gtk_tree_view_get_selection (tv); diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c index ab52502d..9dd07700 100644 --- a/src/fs/gnunet-fs-gtk_publish-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-dialog.c @@ -53,11 +53,6 @@ struct MainPublishingDialogContext */ GtkBuilder *builder; - /** - * Builder for the master window (FIXME: remove) - */ - GtkBuilder *main_window_builder; - /** * Handle to the main window of the publishing dialog. */ @@ -290,7 +285,6 @@ update_selectivity (struct MainPublishingDialogContext *ctx) /* Don't let the user close the dialog until all scanners are finished and their windows are closed */ - /* FIXME: what about open-directory operations? */ if ( (gtk_tree_model_get_iter_first (ctx->file_info_treemodel, &iter)) && (ns_ok == GNUNET_YES) && (ctx->adddir_head == NULL) ) @@ -299,7 +293,6 @@ update_selectivity (struct MainPublishingDialogContext *ctx) gtk_widget_set_sensitive (ctx->execute_button, FALSE); /* if an 'edit' operation is open, don't even allow "cancel" */ - /* FIXME: what about open-directory operations? */ if (ctx->adddir_head == NULL) gtk_widget_set_sensitive (ctx->cancel_button, TRUE); else @@ -1388,7 +1381,7 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")), TRUE); - /* FIXME-UGLY: automatically connect using glade instead */ + /* FIXME-STYLE: automatically connect using glade instead */ g_signal_connect (G_OBJECT (ad), "response", G_CALLBACK (publish_file_dialog_response_cb), ctx); combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, @@ -1419,7 +1412,6 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, GtkWidget *ad; GtkComboBox *combo; - /* FIXME-UGLY: should we use a fresh, specific context for this dialog? */ ctx->open_directory_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_directory_dialog.glade", ctx); GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_directory_builder); @@ -1434,7 +1426,7 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, ad = GTK_WIDGET (gtk_builder_get_object (ctx->open_directory_builder, "GNUNET_GTK_publish_directory_dialog")); - /* FIXME-UGLY: automatically connect using glade instead */ + /* FIXME-STYLE: automatically connect using glade instead */ g_signal_connect (G_OBJECT (ad), "response", G_CALLBACK (publish_directory_dialog_response_cb), ctx); combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_directory_builder, @@ -1454,11 +1446,6 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, /** * Context we keep while an "edit" sub-dialog is open. - * - * FIXME-MAYBE: we should probably keep these also in a DLL with the - * master dialog to prevent the master dialog from closing while the - * edit dialog is running? Or are we otherwise already preventing - * this? */ struct EditPublishContext { @@ -1474,12 +1461,6 @@ struct EditPublishContext /** * Position in the tree that is being edited. - * - * FIXME-MAYBE: using a TreeIter here is not great, as the row may be - * moved (or even deleted) while the edit dialog is running. Should - * use a RowReference instead. Also, how do we guard against two - * edit dialogs being opened for the same file? (Shouldn't we store - * the EditPublishContext with, say, the tree model?) */ GtkTreeIter iter; }; @@ -1626,23 +1607,22 @@ free_pseudonym_tree_store (GtkTreeModel * tm, GtkTreeIter * iter) struct GNUNET_CONTAINER_MetaData *meta; struct GNUNET_FS_Namespace *ns; - gtk_tree_model_get (tm, iter, 1, &ns, 4, &meta, -1); + gtk_tree_model_get (tm, iter, + 1, &ns, + 4, &meta, + -1); if (NULL != meta) GNUNET_CONTAINER_meta_data_destroy (meta); if (NULL != ns) - { - /* FIXME-BUG-MAYBE: should we not delete ns here? (resource leak?) */ - // GNUNET_FS_namespace_delete (nso, GNUNET_NO); - } + GNUNET_FS_namespace_delete (ns, GNUNET_NO); /* recursively clean up children */ - if (gtk_tree_model_iter_children (tm, &child, iter)) + if (! gtk_tree_model_iter_children (tm, &child, iter)) + return; + do { - do - { - free_pseudonym_tree_store (tm, &child); - } - while (gtk_tree_model_iter_next (tm, &child)); + free_pseudonym_tree_store (tm, &child); } + while (gtk_tree_model_iter_next (tm, &child)); } @@ -1687,7 +1667,6 @@ close_master_publish_dialog (struct MainPublishingDialogContext *ctx) GtkTreeIter iter; /* Refuse to close until all scanners are finished */ - /* FIXME: what about open-directory operations? */ if (NULL != ctx->adddir_head) return GNUNET_NO; @@ -1754,7 +1733,7 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button, do { fi = get_file_information (ctx->file_info_treemodel, &iter); - /* FIXME: should we convert namespace id and uid from UTF8? */ + /* FIXME-FEATURE-BUG-MINOR: should we convert namespace id and uid from UTF8? */ GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (), fi, namespace, namespace_id, namespace_uid, @@ -1875,7 +1854,7 @@ add_updateable_to_ts (void *cls, const char *last_id, return; GNUNET_CONTAINER_multihashmap_put (uc->seen, &hc, "dummy", GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); - /* FIXME: what if this put fails? Not convinced it cannot... */ + /* FIXME-BUG-MAYBE: what if this put fails? Not convinced it cannot... */ desc = GNUNET_CONTAINER_meta_data_get_first_by_types (last_meta, EXTRACTOR_METATYPE_DESCRIPTION, @@ -1955,8 +1934,10 @@ add_namespace_to_ts (void *cls, const char *name, const GNUNET_HashCode * id) uc.ts = ts; uc.ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); uc.update_called = GNUNET_NO; - gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, name, 1, - uc.ns, 2, NULL /* last-id */ , + gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, + 0, name, + 1, uc.ns, + 2, NULL /* last-id */ , 3, NULL /* last-uri (as string!) */ , 4, NULL /* meta */ , 5, NULL /* next-ID */ , @@ -1984,9 +1965,6 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer user_ GtkTreeView *pseudonym_treeview; ctx = GNUNET_malloc (sizeof (struct MainPublishingDialogContext)); - /* FIXME-UNCLEAN: why bother keeping this one? */ - ctx->main_window_builder = GTK_BUILDER (user_data); - ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_dialog.glade", ctx); if (ctx->builder == NULL) { -- cgit v1.2.3