diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-10 11:40:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-11 04:54:43 +0800 |
commit | 2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch) | |
tree | c34f0cbb7c500ff70f10fce846631b0a948b341c /widgets/menus | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.bz2 gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.lz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.xz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/menus')
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 88 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-model.c | 32 | ||||
-rw-r--r-- | widgets/menus/gal-view-collection.c | 61 | ||||
-rw-r--r-- | widgets/menus/gal-view-etable.c | 26 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.c | 41 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance.c | 99 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.c | 7 |
7 files changed, 199 insertions, 155 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 79d3104a08..974cdad323 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -71,12 +71,15 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *class) object_class->get_property = gal_define_views_dialog_get_property; object_class->dispose = gal_define_views_dialog_dispose; - g_object_class_install_property (object_class, PROP_COLLECTION, - g_param_spec_object ("collection", - "Collection", - NULL, - GAL_VIEW_COLLECTION_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_COLLECTION, + g_param_spec_object ( + "collection", + "Collection", + NULL, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); } /* Button callbacks */ @@ -94,10 +97,11 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, switch (id) { case GTK_RESPONSE_OK: - g_object_get (widget, - "name", &name, - "factory", &factory, - NULL); + g_object_get ( + widget, + "name", &name, + "factory", &factory, + NULL); if (name && factory) { g_strchomp (name); @@ -107,10 +111,11 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, item = dialog->collection->view_data[dialog->collection->view_count - 1]; gtk_list_store_append (GTK_LIST_STORE (dialog->model), &iter); - gtk_list_store_set (GTK_LIST_STORE (dialog->model), &iter, - COL_GALVIEW_NAME, name, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + GTK_LIST_STORE (dialog->model), &iter, + COL_GALVIEW_NAME, name, + COL_GALVIEW_DATA, item, + -1); if (view && GAL_VIEW_GET_CLASS (view)->edit) gal_view_edit (view, GTK_WINDOW (dialog)); @@ -268,9 +273,10 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) g_object_unref (widget); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, - NULL); + gtk_dialog_add_buttons ( + GTK_DIALOG (dialog), + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + NULL); dialog->treeview = GTK_TREE_VIEW (e_builder_get_widget (dialog->builder, "treeview1")); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE); @@ -330,16 +336,18 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - COL_GALVIEW_NAME, title, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + store, &iter, + COL_GALVIEW_NAME, title, + COL_GALVIEW_DATA, item, + -1); g_free (title); } - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (store), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); /* attaching treeview to model */ gtk_tree_view_set_model (dialog->treeview, GTK_TREE_MODEL (store)); @@ -348,30 +356,36 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, dialog->model = GTK_TREE_MODEL (store); renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (dialog->treeview, - COL_GALVIEW_NAME, _("Name"), - renderer, "text", COL_GALVIEW_NAME, - NULL); + gtk_tree_view_insert_column_with_attributes ( + dialog->treeview, + COL_GALVIEW_NAME, _("Name"), + renderer, "text", COL_GALVIEW_NAME, + NULL); /* set sort column */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (dialog->model), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); if (dialog->builder) { GtkWidget *widget = e_builder_get_widget (dialog->builder, "label-views"); if (widget && GTK_IS_LABEL (widget)) { if (collection->title) { - gchar *text = g_strdup_printf (_("Define Views for %s"), - collection->title); - gtk_label_set_text (GTK_LABEL (widget), - text); + gchar *text = g_strdup_printf ( + _("Define Views for %s"), + collection->title); + gtk_label_set_text ( + GTK_LABEL (widget), + text); gtk_window_set_title (GTK_WINDOW (dialog), text); g_free (text); } else { - gtk_label_set_text (GTK_LABEL (widget), - _("Define Views")); - gtk_window_set_title (GTK_WINDOW (dialog), - _("Define Views")); + gtk_label_set_text ( + GTK_LABEL (widget), + _("Define Views")); + gtk_window_set_title ( + GTK_WINDOW (dialog), + _("Define Views")); } } } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 3fc6d701f5..d9432d24cc 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -245,19 +245,25 @@ gal_define_views_model_class_init (GalDefineViewsModelClass *class) object_class->set_property = gal_define_views_model_set_property; object_class->get_property = gal_define_views_model_get_property; - g_object_class_install_property (object_class, PROP_EDITABLE, - g_param_spec_boolean ("editable", - "Editable", - NULL, - FALSE, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_COLLECTION, - g_param_spec_object ("collection", - "Collection", - NULL, - GAL_VIEW_COLLECTION_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_EDITABLE, + g_param_spec_boolean ( + "editable", + "Editable", + NULL, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_COLLECTION, + g_param_spec_object ( + "collection", + "Collection", + NULL, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); model_class->column_count = gdvm_col_count; model_class->row_count = gdvm_row_count; diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 662b928b95..85dcc32f13 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -63,9 +63,10 @@ gal_view_collection_display_view (GalViewCollection *collection, g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (GAL_IS_VIEW (view)); - g_signal_emit (collection, - gal_view_collection_signals[DISPLAY_VIEW], 0, - view); + g_signal_emit ( + collection, + gal_view_collection_signals[DISPLAY_VIEW], 0, + view); } static void @@ -73,8 +74,9 @@ gal_view_collection_changed (GalViewCollection *collection) { g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_signal_emit (collection, - gal_view_collection_signals[CHANGED], 0); + g_signal_emit ( + collection, + gal_view_collection_signals[CHANGED], 0); } static void @@ -83,8 +85,9 @@ gal_view_collection_item_free (GalViewCollectionItem *item) g_free (item->id); if (item->view) { if (item->view_changed_id) - g_signal_handler_disconnect (item->view, - item->view_changed_id); + g_signal_handler_disconnect ( + item->view, + item->view_changed_id); g_object_unref (item->view); } g_free (item); @@ -196,23 +199,24 @@ gal_view_collection_class_init (GalViewCollectionClass *class) object_class->dispose = gal_view_collection_dispose; - gal_view_collection_signals[DISPLAY_VIEW] = - g_signal_new ("display_view", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewCollectionClass, display_view), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GAL_TYPE_VIEW); - - gal_view_collection_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewCollectionClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + gal_view_collection_signals[DISPLAY_VIEW] = g_signal_new ( + "display_view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewCollectionClass, display_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GAL_TYPE_VIEW); + + gal_view_collection_signals[CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewCollectionClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->display_view = NULL; class->changed = NULL; @@ -310,9 +314,9 @@ view_changed (GalView *view, item->changed = TRUE; item->ever_changed = TRUE; - g_signal_handler_block (G_OBJECT (item->view), item->view_changed_id); + g_signal_handler_block (item->view, item->view_changed_id); gal_view_collection_changed (item->collection); - g_signal_handler_unblock (G_OBJECT (item->view), item->view_changed_id); + g_signal_handler_unblock (item->view, item->view_changed_id); } /* Use factory list to load a GalView file. */ @@ -788,8 +792,9 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gal_view_set_title (view, item->title); g_object_ref (view); if (item->view) { - g_signal_handler_disconnect (item->view, - item->view_changed_id); + g_signal_handler_disconnect ( + item->view, + item->view_changed_id); g_object_unref (item->view); } item->view = view; diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index c097db0ded..01435f94d3 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -36,8 +36,9 @@ detach_table (GalViewEtable *view) if (view->table == NULL) return; if (view->table_state_changed_id) { - g_signal_handler_disconnect (view->table, - view->table_state_changed_id); + g_signal_handler_disconnect ( + view->table, + view->table_state_changed_id); view->table_state_changed_id = 0; } g_object_unref (view->table); @@ -50,8 +51,9 @@ detach_tree (GalViewEtable *view) if (view->tree == NULL) return; if (view->tree_state_changed_id) { - g_signal_handler_disconnect (view->tree, - view->tree_state_changed_id); + g_signal_handler_disconnect ( + view->tree, + view->tree_state_changed_id); view->tree_state_changed_id = 0; } g_object_unref (view->tree); @@ -65,9 +67,10 @@ config_changed (ETableConfig *config, ETableState *state; if (view->state) g_object_unref (view->state); - g_object_get (config, - "state", &state, - NULL); + g_object_get ( + config, + "state", &state, + NULL); view->state = e_table_state_duplicate (state); g_object_unref (state); @@ -81,10 +84,11 @@ gal_view_etable_edit (GalView *view, GalViewEtable *etable_view = GAL_VIEW_ETABLE (view); ETableConfig *config; - config = e_table_config_new (etable_view->title, - etable_view->spec, - etable_view->state, - parent); + config = e_table_config_new ( + etable_view->title, + etable_view->spec, + etable_view->state, + parent); g_signal_connect ( config, "changed", diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index a213082702..df1d1ca743 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -68,15 +68,17 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - COL_GALVIEW_NAME, title, - COL_GALVIEW_DATA, item, - -1); + gtk_list_store_set ( + store, &iter, + COL_GALVIEW_NAME, title, + COL_GALVIEW_DATA, item, + -1); g_free (title); } - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (store), COL_GALVIEW_NAME, GTK_SORT_ASCENDING); /* attaching treeview to model */ @@ -87,14 +89,16 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (dialog->treeview, - COL_GALVIEW_NAME, _("Name"), - renderer, "text", COL_GALVIEW_NAME, - NULL); + gtk_tree_view_insert_column_with_attributes ( + dialog->treeview, + COL_GALVIEW_NAME, _("Name"), + renderer, "text", COL_GALVIEW_NAME, + NULL); /* set sort column */ - gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model), - COL_GALVIEW_NAME, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id ( + GTK_TREE_SORTABLE (dialog->model), + COL_GALVIEW_NAME, GTK_SORT_ASCENDING); } static void @@ -227,12 +231,15 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *c object_class->get_property = gal_view_instance_save_as_dialog_get_property; object_class->dispose = gal_view_instance_save_as_dialog_dispose; - g_object_class_install_property (object_class, PROP_INSTANCE, - g_param_spec_object ("instance", - "Instance", - NULL, - GAL_VIEW_INSTANCE_TYPE, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_INSTANCE, + g_param_spec_object ( + "instance", + "Instance", + NULL, + GAL_VIEW_INSTANCE_TYPE, + G_PARAM_READWRITE)); } static void diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index e73b6fb304..97ba252a0b 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -65,8 +65,9 @@ gal_view_instance_changed (GalViewInstance *instance) g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); - g_signal_emit (instance, - gal_view_instance_signals[CHANGED], 0); + g_signal_emit ( + instance, + gal_view_instance_signals[CHANGED], 0); } static void @@ -76,9 +77,10 @@ gal_view_instance_display_view (GalViewInstance *instance, g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); - g_signal_emit (instance, - gal_view_instance_signals[DISPLAY_VIEW], 0, - view); + g_signal_emit ( + instance, + gal_view_instance_signals[DISPLAY_VIEW], 0, + view); } static void @@ -120,8 +122,9 @@ disconnect_view (GalViewInstance *instance) { if (instance->current_view) { if (instance->view_changed_id) { - g_signal_handler_disconnect (instance->current_view, - instance->view_changed_id); + g_signal_handler_disconnect ( + instance->current_view, + instance->view_changed_id); } g_object_unref (instance->current_view); @@ -158,8 +161,9 @@ gal_view_instance_dispose (GObject *object) if (instance->collection) { if (instance->collection_changed_id) { - g_signal_handler_disconnect (instance->collection, - instance->collection_changed_id); + g_signal_handler_disconnect ( + instance->collection, + instance->collection_changed_id); } g_object_unref (instance->collection); } @@ -184,32 +188,33 @@ gal_view_instance_class_init (GalViewInstanceClass *class) object_class->dispose = gal_view_instance_dispose; - gal_view_instance_signals[DISPLAY_VIEW] = - g_signal_new ("display_view", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewInstanceClass, display_view), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GAL_TYPE_VIEW); - - gal_view_instance_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GalViewInstanceClass, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gal_view_instance_signals[LOADED] = - g_signal_new ("loaded", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GalViewInstanceClass, loaded), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + gal_view_instance_signals[DISPLAY_VIEW] = g_signal_new ( + "display_view", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewInstanceClass, display_view), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GAL_TYPE_VIEW); + + gal_view_instance_signals[CHANGED] = g_signal_new ( + "changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GalViewInstanceClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gal_view_instance_signals[LOADED] = g_signal_new ( + "loaded", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GalViewInstanceClass, loaded), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); class->display_view = NULL; class->changed = NULL; @@ -270,12 +275,13 @@ load_current_view (GalViewInstance *instance) instance->current_id = g_strdup (gal_view_instance_get_default_view (instance)); if (instance->current_id) { - gint index = gal_view_collection_get_view_index_by_id (instance->collection, - instance->current_id); + gint index = gal_view_collection_get_view_index_by_id ( + instance->collection, + instance->current_id); if (index != -1) { - view = gal_view_collection_get_view (instance->collection, - index); + view = gal_view_collection_get_view ( + instance->collection, index); view = gal_view_clone (view); connect_view (instance, view); } @@ -287,21 +293,22 @@ load_current_view (GalViewInstance *instance) instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view", NULL); if (instance->current_id != NULL) { - gint index = gal_view_collection_get_view_index_by_id (instance->collection, - instance->current_id); + gint index = gal_view_collection_get_view_index_by_id ( + instance->collection, + instance->current_id); if (index != -1) { - view = gal_view_collection_get_view (instance->collection, - index); + view = gal_view_collection_get_view ( + instance->collection, index); view = gal_view_clone (view); } } if (view == NULL) { gchar *type; type = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view_type", NULL); - view = gal_view_collection_load_view_from_file (instance->collection, - type, - instance->custom_filename); + view = gal_view_collection_load_view_from_file ( + instance->collection, type, + instance->custom_filename); g_free (type); } diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 0e99e3271c..b0de7156dc 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -179,8 +179,9 @@ GtkWidget * gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = - gal_view_new_dialog_construct (g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), - collection); + gal_view_new_dialog_construct ( + g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), + collection); return widget; } @@ -255,7 +256,7 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column); iterator = dialog->collection->factory_list; - for (; iterator; iterator = g_list_next (iterator) ) { + for (; iterator; iterator = g_list_next (iterator)) { GalViewFactory *factory = iterator->data; GtkTreeIter iter; |