diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-23 12:04:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-23 12:04:56 +0800 |
commit | 9acd121a93cf023501b48992ebe4341d4220301c (patch) | |
tree | 2506a9361c0043d7513d124abdd964467a750b98 /widgets/table | |
parent | 53d9c34bb570d65740de43f8a711dc6cc53d5977 (diff) | |
download | gsoc2013-evolution-9acd121a93cf023501b48992ebe4341d4220301c.tar.gz gsoc2013-evolution-9acd121a93cf023501b48992ebe4341d4220301c.tar.zst gsoc2013-evolution-9acd121a93cf023501b48992ebe4341d4220301c.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-cell-date-edit.c | 46 | ||||
-rw-r--r-- | widgets/table/e-table-extras.c | 42 | ||||
-rw-r--r-- | widgets/table/e-table-header.c | 26 |
3 files changed, 76 insertions, 38 deletions
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 39443c3960..f67a03ceed 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -95,7 +95,8 @@ static void e_cell_date_edit_on_today_clicked (GtkWidget *button, ECellDateEdit *ecde); static void e_cell_date_edit_update_cell (ECellDateEdit *ecde, const gchar *text); -static void e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, ECellDateEdit *ecde); +static void e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, + ECellDateEdit *ecde); static void e_cell_date_edit_hide_popup (ECellDateEdit *ecde); /* Our arguments. */ @@ -272,20 +273,26 @@ e_cell_date_edit_init (ECellDateEdit *ecde) gtk_tree_view_append_column ( GTK_TREE_VIEW (tree_view), - gtk_tree_view_column_new_with_attributes ("Text", gtk_cell_renderer_text_new (), "text", 0, NULL)); + gtk_tree_view_column_new_with_attributes ( + "Text", gtk_cell_renderer_text_new (), "text", 0, NULL)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), tree_view); - gtk_container_set_focus_vadjustment (GTK_CONTAINER (tree_view), - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_window))); - gtk_container_set_focus_hadjustment (GTK_CONTAINER (tree_view), - gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled_window))); + gtk_scrolled_window_add_with_viewport ( + GTK_SCROLLED_WINDOW (scrolled_window), tree_view); + gtk_container_set_focus_vadjustment ( + GTK_CONTAINER (tree_view), + gtk_scrolled_window_get_vadjustment ( + GTK_SCROLLED_WINDOW (scrolled_window))); + gtk_container_set_focus_hadjustment ( + GTK_CONTAINER (tree_view), + gtk_scrolled_window_get_hadjustment ( + GTK_SCROLLED_WINDOW (scrolled_window))); gtk_widget_show (tree_view); ecde->time_tree_view = tree_view; - g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)), "changed", - G_CALLBACK (e_cell_date_edit_on_time_selected), - ecde); + g_signal_connect ( + gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)), "changed", + G_CALLBACK (e_cell_date_edit_on_time_selected), ecde); bbox = gtk_hbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); @@ -527,7 +534,9 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) if (status == E_TIME_PARSE_NONE || status == E_TIME_PARSE_INVALID) { gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), ""); e_calendar_item_set_selection (calitem, NULL, NULL); - gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (ecde->time_tree_view))); + gtk_tree_selection_unselect_all ( + gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecde->time_tree_view))); } else { if (is_date) { buffer[0] = '\0'; @@ -543,7 +552,9 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) e_calendar_item_set_selection (calitem, &date, &date); if (is_date) { - gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (ecde->time_tree_view))); + gtk_tree_selection_unselect_all ( + gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecde->time_tree_view))); } else { e_cell_date_edit_select_matching_time (ecde, buffer); } @@ -575,8 +586,12 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, if (g_str_equal (str, time)) { GtkTreePath *path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_set_cursor (GTK_TREE_VIEW (ecde->time_tree_view), path, NULL, FALSE); - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (ecde->time_tree_view), path, NULL, FALSE, 0.0, 0.0); + gtk_tree_view_set_cursor ( + GTK_TREE_VIEW (ecde->time_tree_view), + path, NULL, FALSE); + gtk_tree_view_scroll_to_cell ( + GTK_TREE_VIEW (ecde->time_tree_view), + path, NULL, FALSE, 0.0, 0.0); gtk_tree_path_free (path); found = TRUE; @@ -740,7 +755,8 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) struct tm tmp_tm; gint hour, min; - store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (ecde->time_tree_view))); + store = GTK_LIST_STORE (gtk_tree_view_get_model ( + GTK_TREE_VIEW (ecde->time_tree_view))); gtk_list_store_clear (store); /* Fill the struct tm with some sane values. */ diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index 101e3e426b..cdb0360a81 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -101,8 +101,8 @@ static gint e_strint_compare (gconstpointer data1, gconstpointer data2) { - gint int1 = atoi(data1); - gint int2 = atoi(data2); + gint int1 = atoi (data1); + gint int2 = atoi (data2); return e_int_compare (GINT_TO_POINTER (int1), GINT_TO_POINTER (int2)); } @@ -256,35 +256,45 @@ ete_init (ETableExtras *extras) (GDestroyNotify) g_free, (GDestroyNotify) NULL); - e_table_extras_add_compare(extras, "string", (GCompareDataFunc) e_str_compare); - e_table_extras_add_compare(extras, "stringcase", e_table_str_case_compare); - e_table_extras_add_compare(extras, "collate", e_table_collate_compare); - e_table_extras_add_compare(extras, "integer", (GCompareDataFunc) e_int_compare); - e_table_extras_add_compare(extras, "string-integer", (GCompareDataFunc) e_strint_compare); - - e_table_extras_add_search(extras, "string", e_string_search); + e_table_extras_add_compare ( + extras, "string", + (GCompareDataFunc) e_str_compare); + e_table_extras_add_compare ( + extras, "stringcase", + (GCompareDataFunc) e_table_str_case_compare); + e_table_extras_add_compare ( + extras, "collate", + (GCompareDataFunc) e_table_collate_compare); + e_table_extras_add_compare ( + extras, "integer", + (GCompareDataFunc) e_int_compare); + e_table_extras_add_compare ( + extras, "string-integer", + (GCompareDataFunc) e_strint_compare); + + e_table_extras_add_search (extras, "string", e_string_search); cell = e_cell_checkbox_new (); - e_table_extras_add_cell(extras, "checkbox", cell); + e_table_extras_add_cell (extras, "checkbox", cell); cell = e_cell_date_new (NULL, GTK_JUSTIFY_LEFT); - e_table_extras_add_cell(extras, "date", cell); + e_table_extras_add_cell (extras, "date", cell); cell = e_cell_number_new (NULL, GTK_JUSTIFY_RIGHT); - e_table_extras_add_cell(extras, "number", cell); + e_table_extras_add_cell (extras, "number", cell); cell = e_cell_pixbuf_new (); - e_table_extras_add_cell(extras, "pixbuf", cell); + e_table_extras_add_cell (extras, "pixbuf", cell); cell = e_cell_size_new (NULL, GTK_JUSTIFY_RIGHT); - e_table_extras_add_cell(extras, "size", cell); + e_table_extras_add_cell (extras, "size", cell); cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - e_table_extras_add_cell(extras, "string", cell); + e_table_extras_add_cell (extras, "string", cell); cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); cell = e_cell_tree_new (NULL, NULL, TRUE, cell); - e_table_extras_add_cell(extras, "tree-string", cell); + e_table_extras_add_cell (extras, "tree-string", cell); } ETableExtras * diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 8d382f5a92..e5587ab3e2 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -91,7 +91,8 @@ dequeue_idle (ETableHeader *eth) gint column, width; dequeue (eth, &column, &width); - while (eth->change_queue && ((struct two_ints *) eth->change_queue->data)->column == column) + while (eth->change_queue && ((struct two_ints *) + eth->change_queue->data)->column == column) dequeue (eth, &column, &width); if (column == -1) @@ -207,7 +208,9 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec case PROP_SORT_INFO: if (eth->sort_info) { if (eth->sort_info_group_change_id) - g_signal_handler_disconnect(G_OBJECT(eth->sort_info), eth->sort_info_group_change_id); + g_signal_handler_disconnect ( + G_OBJECT(eth->sort_info), + eth->sort_info_group_change_id); g_object_unref (eth->sort_info); } eth->sort_info = E_TABLE_SORT_INFO(g_value_get_object (val)); @@ -631,7 +634,9 @@ e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) g_return_if_fail (source_index >= 0); g_return_if_fail (target_index >= 0); g_return_if_fail (source_index < eth->col_count); - g_return_if_fail (target_index < eth->col_count + 1); /* Can be moved beyond the last item. */ + + /* Can be moved beyond the last item. */ + g_return_if_fail (target_index < eth->col_count + 1); if (source_index < target_index) target_index --; @@ -769,7 +774,9 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) old_expansion = expansion; old_expansion -= eth->columns[idx]->expansion; /* Set the new expansion so that it will generate the desired size. */ - eth->columns[idx]->expansion = expansion * (((double)(size - (eth->columns[idx]->min_width + eth->width_extras)))/((double)total_extra)); + eth->columns[idx]->expansion = + expansion * (((double)(size - (eth->columns[idx]->min_width + + eth->width_extras))) / ((double)total_extra)); /* The expansion left for the columns on the right. */ expansion -= eth->columns[idx]->expansion; @@ -861,7 +868,9 @@ eth_calc_widths (ETableHeader *eth) extra -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT; if (expansion != 0 && extra > 0) { for (i = 0; i < last_resizable; i++) { - next_position += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion; + next_position += + extra * (eth->columns[i]->resizable ? + eth->columns[i]->expansion : 0) / expansion; widths[i] += next_position - last_position; last_position = next_position; } @@ -927,7 +936,9 @@ e_table_header_prioritized_column (ETableHeader *eth) } ETableCol * -e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFunc check_func, gpointer user_data) +e_table_header_prioritized_column_selected (ETableHeader *eth, + ETableColCheckFunc check_func, + gpointer user_data) { ETableCol *best_col = NULL; gint best_priority = G_MININT; @@ -940,7 +951,8 @@ e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFun for (i = 1; i < count; i++) { ETableCol *col = e_table_header_get_column (eth, i); if (col) { - if ((best_col == NULL || col->priority > best_priority) && check_func (col, user_data)) { + if ((best_col == NULL || col->priority > best_priority) + && check_func (col, user_data)) { best_priority = col->priority; best_col = col; } |