diff options
author | Kjartan Maraas <kmaraas@gnome.org> | 2006-01-30 20:28:21 +0800 |
---|---|---|
committer | Kjartan Maraas <kmaraas@src.gnome.org> | 2006-01-30 20:28:21 +0800 |
commit | 4a4b322c39f2bccddd9b9f41dead3429dab80f57 (patch) | |
tree | febc1d25336e811d024c4fefde19555b07ce8737 /widgets/table | |
parent | 4ce156ab5a105682005b33d6636bf7db87f05bcb (diff) | |
download | gsoc2013-evolution-4a4b322c39f2bccddd9b9f41dead3429dab80f57.tar.gz gsoc2013-evolution-4a4b322c39f2bccddd9b9f41dead3429dab80f57.tar.zst gsoc2013-evolution-4a4b322c39f2bccddd9b9f41dead3429dab80f57.zip |
Tons of cleanups of the following sort: - remove unused vars - remove
2006-01-30 Kjartan Maraas <kmaraas@gnome.org>
* e-timezone-dialog/e-timezone-dialog.c: (get_zone_from_point):
* menus/gal-view-menus.c:
* misc/e-attachment-bar.c: (calculate_height_width),
(update_remote_file), (e_attachment_bar_get_attachment),
(class_init):
* misc/e-attachment.c: (async_progress_update_cb),
(download_to_local_path):
* misc/e-calendar-item.c: (e_calendar_item_get_arg),
(e_calendar_item_realize), (e_calendar_item_ensure_days_visible):
* misc/e-calendar.c: (e_calendar_drag_motion),
(e_calendar_drag_leave), (e_calendar_focus):
* misc/e-canvas-background.c: (ecb_get_property):
* misc/e-canvas.c: (e_canvas_class_init), (pick_current_item):
* misc/e-cell-date-edit.c: (e_cell_date_edit_do_popup),
(e_cell_date_edit_show_popup):
* misc/e-cell-percent.c:
* misc/e-charset-picker.c: (e_charset_picker_bonobo_ui_populate):
* misc/e-config-page.c: (e_config_page_class_init):
* misc/e-dateedit.c: (e_date_edit_set_date),
(e_date_edit_set_date_and_time_of_day),
(on_date_popup_date_selected):
* misc/e-dropdown-button.c: (e_dropdown_button_class_init):
* misc/e-expander.c: (get_expander_bounds), (e_expander_expose),
(is_in_expander_panel):
* misc/e-filter-bar.c: (option_changed), (build_items):
* misc/e-image-chooser.c: (e_image_chooser_init),
(image_drag_data_received_cb):
* misc/e-map.c: (e_map_size_allocate), (e_map_button_press),
(e_map_button_release), (e_map_motion), (e_map_zoom_to_location),
(e_map_zoom_out), (update_render_point), (repaint_point),
(zoom_in_smooth):
* misc/e-multi-config-dialog.c: (impl_response):
* misc/e-reflow.c: (e_reflow_realize), (e_reflow_event):
* misc/e-search-bar.c: (clear_search), (search_now_verb_cb),
(entry_activated_cb), (activate_button_clicked_cb),
(clear_button_clicked_cb):
* misc/e-selection-model.c: (e_selection_model_key_press):
* misc/e-send-options.c: (delay_until_date_changed_cb),
(e_sendoptions_get_need_general_options):
* misc/e-unicode.c: (e_stripped_char):
* table/e-cell-progress.c: (eprog_draw_border), (eprog_draw),
(eprog_event):
* table/e-cell-spin-button.c: (ecsb_event), (ecsb_focus),
(ecsb_unfocus), (ecsb_dispose):
* table/e-cell-text.c: (ect_draw), (ect_show_tooltip):
* table/e-cell-toggle.c: (etog_draw), (etog_event):
* table/e-cell-tree.c: (ect_max_width):
* table/e-cell-vbox.c:
* table/e-table-click-to-add.c: (etcta_event):
* table/e-table-config.c: (create_global_store):
* table/e-table-field-chooser-dialog.c:
* table/e-table-field-chooser-item.c: (etfci_find_button),
(etfci_reflow), (etfci_get_property), (etfci_realize):
* table/e-table-field-chooser.c:
(e_table_field_chooser_class_init):
* table/e-table-group-container.c: (etgc_unrealize):
* table/e-table-group.c: (e_table_group_new):
* table/e-table-header-item.c: (e_table_header_item_get_height),
(ethi_realize), (ethi_event):
* table/e-table-header-utils.c: (e_table_draw_elided_string),
(e_table_header_draw_button):
* table/e-table-item.c: (eti_set_property), (eti_get_property),
(eti_draw), (eti_event), (eti_cursor_change):
* table/e-table-scrolled.c: (e_table_scrolled_class_init):
* table/e-table-search.c:
* table/e-table-sort-info.c: (e_table_sort_info_save_to_node):
* table/e-table.c: (table_canvas_reflow_idle),
(table_canvas_size_allocate), (canvas_vbox_event),
(click_to_add_event), (do_drag_motion), (e_table_class_init):
* table/e-tree-scrolled.c: (e_tree_scrolled_class_init):
* table/e-tree.c: (tree_canvas_reflow_idle),
(tree_canvas_size_allocate), (e_tree_drag_get_data),
(do_drag_motion), (e_tree_class_init):
* text/e-text.c: (e_text_set_property), (e_text_draw),
(_do_tooltip), (primary_clear_cb), (_get_position),
(e_text_command): Tons of cleanups of the following sort:
- remove unused vars
- remove extraneous semi-colons
- add some comments where assignments were done without using
the results later
- remove break; statements after return foo;
- add casts in some places to be more type correct
- rename variables with name clashes
- s/if/ifdef in some cases
- mark some code static
- remove some unused functions
- use guint for 1-bit bitfields
svn path=/trunk/; revision=31371
Diffstat (limited to 'widgets/table')
25 files changed, 40 insertions, 182 deletions
diff --git a/widgets/table/e-cell-progress.c b/widgets/table/e-cell-progress.c index 10ce1c8291..8e10d7cc31 100644 --- a/widgets/table/e-cell-progress.c +++ b/widgets/table/e-cell-progress.c @@ -110,7 +110,7 @@ eprog_clear (ECellProgress *progress) static void eprog_draw_border (ECellProgress *progress, guchar red, guchar green, guchar blue) { - gint i, j, w4, p4, pw4, wpb4, hp1; + gint i, j, w4, p4, pw4, wpb4; /* * some speedup @@ -119,7 +119,6 @@ eprog_draw_border (ECellProgress *progress, guchar red, guchar green, guchar blu p4=progress->padding*4; pw4=w4*progress->padding; wpb4=(progress->width-progress->padding-progress->border)*4; - hp1=(progress->height-progress->padding-1); for (i=progress->padding*4;i<(progress->width-progress->padding)*4;i+=4){ for (j=0;j<progress->border;j++){ @@ -172,37 +171,27 @@ eprog_draw (ECellView *ecell_view, GdkDrawable *drawable, int x1, int y1, int x2, int y2) { ECellProgress *progress = E_CELL_PROGRESS (ecell_view->ecell); - gboolean selected; - GdkPixbuf *image; - int x, y, width, height; + int x, y; const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - selected = flags & E_CELL_SELECTED; - if ((value > progress->max)||(value < progress->min)){ g_warning ("Value from the table model is %d, the states we support are [%d..%d]\n", value, progress->min, progress->max); return; } - image = progress->image; - if ((x2 - x1) < progress->width){ x = x1; - width = x2 - x1; } else { x = x1 + ((x2 - x1) - progress->width) / 2; - width = progress->width; } if ((y2 - y1) < progress->height){ y = y1; - height = y2 - y1; } else { y = y1 + ((y2 - y1) - progress->height) / 2; - height = progress->height; } eprog_clear(progress); @@ -267,7 +256,6 @@ eprog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col default: return FALSE; } - return TRUE; } /* @@ -323,7 +311,7 @@ e_cell_progress_class_init (GObjectClass *object_class) parent_class = g_type_class_ref (PARENT_TYPE); } -E_MAKE_TYPE(e_cell_progress, "ECellProgress", ECellProgress, e_cell_progress_class_init, NULL, PARENT_TYPE); +E_MAKE_TYPE(e_cell_progress, "ECellProgress", ECellProgress, e_cell_progress_class_init, NULL, PARENT_TYPE) /** * e_cell_progress_construct: diff --git a/widgets/table/e-cell-spin-button.c b/widgets/table/e-cell-spin-button.c index c6112bf3b8..9a4d935d60 100644 --- a/widgets/table/e-cell-spin-button.c +++ b/widgets/table/e-cell-spin-button.c @@ -338,7 +338,6 @@ ecsb_event (ECellView *ecv, ECellActions *actions) { ECellSpinButton *ecsb; - ECellSpinButtonClass *ecsb_class; ECellSpinButtonView *ecsb_view; ETableItem *eti; gint height, width; @@ -347,7 +346,6 @@ ecsb_event (ECellView *ecv, ecsb_view = (ECellSpinButtonView *) ecv; ecsb = E_CELL_SPIN_BUTTON (ecsb_view->cell_view.ecell); - ecsb_class = E_CELL_SPIN_BUTTON_CLASS (GTK_OBJECT_GET_CLASS (ecsb)); eti = E_TABLE_ITEM (ecsb_view->cell_view.e_table_item_view); switch (event->type) { @@ -469,10 +467,7 @@ ecsb_focus (ECellView *ecell_view, int y2) { ECellClass *klass; - ECellSpinButtonView *ecsb_view; - ecsb_view = (ECellSpinButtonView *) ecell_view; - klass = E_CELL_GET_CLASS (ecell_view->ecell); if (klass->focus) @@ -484,9 +479,7 @@ static void ecsb_unfocus (ECellView *ecell_view) { ECellClass *klass; - ECellSpinButtonView *ecsb_view; - ecsb_view = (ECellSpinButtonView *) ecell_view; klass = E_CELL_GET_CLASS (ecell_view->ecell); if (klass->unfocus) @@ -514,13 +507,9 @@ ecsb_show_tooltip (ECellView *ecv, static void ecsb_dispose (GObject *object) { - ECellSpinButton *mcsp; - g_return_if_fail (object != NULL); g_return_if_fail (M_IS_CELL_SPIN_BUTTON (object)); - mcsp = E_CELL_SPIN_BUTTON (object); - G_OBJECT_CLASS (parent_class)->dispose (object); } diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 33ec7a6fa1..db66f13550 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -704,7 +704,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, ECellText *ect = E_CELL_TEXT (ecell_view->ecell); CellEdit *edit = text_view->edit; gboolean selected; - GdkColor *foreground, *cursor_color; + GdkColor *foreground; GtkWidget *canvas = GTK_WIDGET (text_view->canvas); GdkRectangle clip_rect; int x_origin, y_origin; @@ -716,10 +716,8 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, foreground = &canvas->style->fg [GTK_STATE_SELECTED]; else foreground = &canvas->style->fg [GTK_STATE_ACTIVE]; - cursor_color = foreground; } else { foreground = &canvas->style->text [GTK_STATE_NORMAL]; - cursor_color = foreground; if (ect->color_column != -1) { char *color_spec; @@ -1544,6 +1542,10 @@ ect_show_tooltip (ECellView *ecell_view, tooltip_height = height; tooltip_y = tooltip->y; + /* This looks very broken since tooltip_x is never used?! + * Maybe tooltip->x is what was meant here and just get rid of + * both tooltip_x and tooltip_y? + */ switch (E_CELL_TEXT (text_view->cell_view.ecell)->justify) { case GTK_JUSTIFY_CENTER: tooltip_x = - tooltip_width / 2; diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index e90026399a..2892b18598 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -189,7 +189,6 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, int x1, int y1, int x2, int y2) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); - gboolean selected; ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; GdkPixmap *pixmap; GdkPixbuf *image; @@ -199,8 +198,6 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - selected = flags & E_CELL_SELECTED; - if (value < 0 || value >= toggle->n_states){ g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", value, toggle->n_states); @@ -289,7 +286,6 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, default: return FALSE; } - return TRUE; } /* diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index c632a16966..d42a067931 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -574,7 +574,7 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row); ETreePath node; GdkPixbuf *node_image; - int node_image_width = 0, node_image_height = 0; + int node_image_width = 0; int offset, subcell_offset; #if 0 @@ -591,7 +591,6 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) if (node_image) { node_image_width = gdk_pixbuf_get_width (node_image); - node_image_height = gdk_pixbuf_get_height (node_image); } width = subcell_offset + node_image_width; diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 91a25ec8c4..bfc140e9fd 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -446,7 +446,7 @@ e_cell_vbox_init (GtkObject *object) ecv->subcell_count = 0; } -E_MAKE_TYPE(e_cell_vbox, "ECellVbox", ECellVbox, e_cell_vbox_class_init, e_cell_vbox_init, PARENT_TYPE); +E_MAKE_TYPE(e_cell_vbox, "ECellVbox", ECellVbox, e_cell_vbox_class_init, e_cell_vbox_init, PARENT_TYPE) /** * e_cell_vbox_new: diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 76e0155169..a338df9cc5 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -433,7 +433,6 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) break; default: return FALSE; - break; } break; diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 7923a21d9a..38d52b15ab 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -513,7 +513,7 @@ do_fields_config_dialog (ETableConfig *config) } -ETableMemoryStoreColumnInfo store_columns[] = { +static ETableMemoryStoreColumnInfo store_columns[] = { E_TABLE_MEMORY_STORE_STRING, E_TABLE_MEMORY_STORE_INTEGER, E_TABLE_MEMORY_STORE_TERMINATOR @@ -539,53 +539,6 @@ create_global_store (ETableConfig *config) } } -char *spec = "<ETableSpecification gettext-domain=\"" E_I18N_DOMAIN "\" no-headers=\"true\" cursor-mode=\"line\" " - " draw-grid=\"false\" draw-focus=\"true\" selection-mode=\"browse\">" - "<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" - "<ETableState> <column source=\"0\"/>" - "<grouping/>" - "</ETableState>" - "</ETableSpecification>"; - -GtkWidget *e_table_proxy_etable_shown_new (void); - -GtkWidget * -e_table_proxy_etable_shown_new (void) -{ - ETableModel *model = NULL; - GtkWidget *widget; - ETableScrolled *ets; - - model = e_table_subset_variable_new (global_store); - - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Show Fields")); - - return widget; -} - -GtkWidget *e_table_proxy_etable_available_new (void); - -GtkWidget * -e_table_proxy_etable_available_new (void) -{ - ETableModel *model; - GtkWidget *widget; - ETableScrolled *ets; - - model = e_table_without_new (global_store, - NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - e_table_without_show_all (E_TABLE_WITHOUT (model)); - - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Available Fields")); - - return widget; -} - static void config_button_fields (GtkWidget *widget, ETableConfig *config) { diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index 8c3c9eb883..9845dd7fbc 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -53,7 +53,7 @@ E_MAKE_TYPE (e_table_field_chooser_dialog, ETableFieldChooserDialog, e_table_field_chooser_dialog_class_init, e_table_field_chooser_dialog_init, - PARENT_TYPE); + PARENT_TYPE) static void e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *klass) diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index c1c2e60400..435b7c63c2 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -98,9 +98,6 @@ etfci_find_button (ETableFieldChooserItem *etfci, double loc) int i; int count; double height = 0; - GtkStyle *style; - - style = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)->style; count = e_table_header_count(etfci->combined_header); for (i = 0; i < count; i++) { @@ -158,12 +155,9 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) int i; int count; double height = 0; - GtkStyle *style; etfci_rebuild_combined (etfci); - style = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas)->style; - old_height = etfci->height; count = e_table_header_count(etfci->combined_header); @@ -369,10 +363,8 @@ etfci_set_property (GObject *object, guint prop_id, const GValue *value, GParamS static void etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GnomeCanvasItem *item; ETableFieldChooserItem *etfci; - item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); switch (prop_id){ @@ -423,13 +415,10 @@ static void etfci_realize (GnomeCanvasItem *item) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); - GdkWindow *window; if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)-> realize) (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->realize)(item); - window = GTK_WIDGET (item->canvas)->window; - if (!etfci->font) etfci_font_load (etfci); @@ -708,4 +697,4 @@ E_MAKE_TYPE (e_table_field_chooser_item, ETableFieldChooserItem, etfci_class_init, etfci_init, - PARENT_OBJECT_TYPE); + PARENT_OBJECT_TYPE) diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index fe6eb3c46c..b3554f86cf 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -55,16 +55,14 @@ E_MAKE_TYPE (e_table_field_chooser, ETableFieldChooser, e_table_field_chooser_class_init, e_table_field_chooser_init, - PARENT_TYPE); + PARENT_TYPE) static void e_table_field_chooser_class_init (ETableFieldChooserClass *klass) { GObjectClass *object_class; - GtkVBoxClass *vbox_class; object_class = (GObjectClass*) klass; - vbox_class = (GtkVBoxClass *) klass; glade_init(); diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 1caeb77a22..632f998c84 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -332,10 +332,6 @@ etgc_realize (GnomeCanvasItem *item) static void etgc_unrealize (GnomeCanvasItem *item) { - ETableGroupContainer *etgc; - - etgc = E_TABLE_GROUP_CONTAINER (item); - if (GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->unrealize) (* GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->unrealize) (item); } diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 008ec07d0a..a7bb72db3e 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -111,7 +111,6 @@ e_table_group_new (GnomeCanvasGroup *parent, } else { return e_table_group_leaf_new (parent, full_header, header, model, sort_info); } - return NULL; } /** diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 2cb6d7db6a..e43fd9fdf5 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -161,7 +161,6 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) ETableHeader *eth; int numcols, col; int maxheight; - GtkStyle *style; g_return_val_if_fail (ethi != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER_ITEM (ethi), 0); @@ -171,8 +170,6 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) maxheight = 0; - style = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)->style; - for (col = 0; col < numcols; col++) { ETableCol *ecol = e_table_header_get_column (eth, col); int height; @@ -896,7 +893,6 @@ static void ethi_realize (GnomeCanvasItem *item) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); - GdkWindow *window; GtkTargetEntry ethi_drop_types [] = { { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; @@ -905,8 +901,6 @@ ethi_realize (GnomeCanvasItem *item) if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)-> realize) (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->realize)(item); - window = GTK_WIDGET (item->canvas)->window; - if (!ethi->font) ethi_font_set (ethi, gtk_style_get_font (GTK_WIDGET (item->canvas)->style)); @@ -1722,10 +1716,10 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) needs_ungrab = (ethi->resize_guide != NULL); ethi_end_resize (ethi); } else if (was_maybe_drag && ethi->sort_info) { - ETableCol *col; + ETableCol *ecol; - col = e_table_header_get_column (ethi->eth, ethi_find_col_by_x (ethi, e->button.x)); - ethi_change_sort_state (ethi, col); + ecol = e_table_header_get_column (ethi->eth, ethi_find_col_by_x (ethi, e->button.x)); + ethi_change_sort_state (ethi, ecol); } if (needs_ungrab) @@ -1736,16 +1730,16 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_KEY_PRESS: if ((e->key.keyval == GDK_F10) && (e->key.state & GDK_SHIFT_MASK)) { EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1); - ETableCol *col; + ETableCol *ecol; GtkMenu *popup; info->ethi = ethi; info->col = ethi->selected_col; - col = e_table_header_get_column (ethi->eth, info->col); + ecol = e_table_header_get_column (ethi->eth, info->col); popup = e_popup_menu_create_with_domain (ethi_context_menu, 1 + - (col->sortable ? 0 : 2) + + (ecol->sortable ? 0 : 2) + ((ethi->table || ethi->tree) ? 0 : 4) + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + @@ -1756,28 +1750,28 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) G_CALLBACK (free_popup_info), info); e_popup_menu (popup, NULL); } else if (e->key.keyval == GDK_space) { - ETableCol *col; + ETableCol *ecol; - col = e_table_header_get_column (ethi->eth, ethi->selected_col); - ethi_change_sort_state (ethi, col); + ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); + ethi_change_sort_state (ethi, ecol); } else if ((e->key.keyval == GDK_Right) || (e->key.keyval == GDK_KP_Right)) { - ETableCol *col; + ETableCol *ecol; if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1)) ethi->selected_col = 0; else ethi->selected_col++; - col = e_table_header_get_column (ethi->eth, ethi->selected_col); - ethi_change_sort_state (ethi, col); + ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); + ethi_change_sort_state (ethi, ecol); } else if ((e->key.keyval == GDK_Left) || (e->key.keyval == GDK_KP_Left)) { - ETableCol *col; + ETableCol *ecol; if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) ethi->selected_col = ethi->eth->col_count - 1; else ethi->selected_col--; - col = e_table_header_get_column (ethi->eth, ethi->selected_col); - ethi_change_sort_state (ethi, col); + ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); + ethi_change_sort_state (ethi, ecol); } break; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 3a5fb64ff1..8a1831bd49 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -294,10 +294,6 @@ e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, gdk_draw_layout (drawable, gc, x, y, layout); for (i = 0; i < arrow_width; i++) { - int h; - - h = 2 * i + 1; - gdk_draw_line (drawable, gc, x + max_width - i, y + height / 2 - i, @@ -435,7 +431,6 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, xpos = inner_x; if (inner_width - pwidth > 11) { - int width; int ypos; pango_layout_get_pixel_size (layout, &width, NULL); diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index a3201aa533..ea020c5710 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1460,11 +1460,9 @@ eti_dispose (GObject *object) static void eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GnomeCanvasItem *item; ETableItem *eti; int cursor_col; - item = GNOME_CANVAS_ITEM (object); eti = E_TABLE_ITEM (object); switch (prop_id){ @@ -1546,11 +1544,9 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe static void eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GnomeCanvasItem *item; ETableItem *eti; int row; - item = GNOME_CANVAS_ITEM (object); eti = E_TABLE_ITEM (object); switch (prop_id){ @@ -1674,7 +1670,7 @@ adjustment_changed (GtkAdjustment *adjustment, ETableItem *eti) static void eti_tree_unfreeze (GtkWidget *widget, GdkEvent *event, ETableItem *eti) { - g_object_set_data (((GnomeCanvasItem *) eti)->canvas, "freeze-cursor", 0); + g_object_set_data (G_OBJECT (((GnomeCanvasItem *) eti)->canvas), "freeze-cursor", 0); } static void @@ -1932,7 +1928,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, yd += height_extra; for (row = first_row; row < last_row; row++){ - int xd, height; + int xd; gboolean selected; gint cursor_col, cursor_row; @@ -2401,7 +2397,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case 4: case 5: return FALSE; - break; } break; @@ -2485,7 +2480,6 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case 4: case 5: return FALSE; - break; } break; @@ -3216,13 +3210,11 @@ static void eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti) { int view_row; - int view_col; if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) return; view_row = model_to_view_row(eti, row); - view_col = model_to_view_col(eti, col); if (eti->old_cursor_row != -1 && view_row != eti->old_cursor_row) e_table_item_redraw_row (eti, eti->old_cursor_row); diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c index 77db176540..fc31f0eef6 100644 --- a/widgets/table/e-table-scrolled.c +++ b/widgets/table/e-table-scrolled.c @@ -205,11 +205,9 @@ e_table_scrolled_class_init (ETableScrolledClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - GtkContainerClass *container_class; object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; - container_class = (GtkContainerClass *) class; parent_class = g_type_class_ref (PARENT_TYPE); diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 162f148ac0..898b179d16 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -31,7 +31,7 @@ #define d(x) -d(static gint depth = 0); +d(static gint depth = 0) struct _ETableSearchPrivate { guint timeout_id; diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index cfb7d2dda6..5bbf443b76 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -418,7 +418,6 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, xmlNode *parent) { xmlNode *grouping; - xmlNode *node; int i; const int sort_count = e_table_sort_info_sorting_get_count (info); const int group_count = e_table_sort_info_grouping_get_count (info); @@ -431,7 +430,6 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, e_xml_set_integer_prop_by_name (new_node, "column", column.column); e_xml_set_bool_prop_by_name (new_node, "ascending", column.ascending); - node = new_node; } for (i = 0; i < sort_count; i++) { @@ -440,7 +438,6 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, e_xml_set_integer_prop_by_name (new_node, "column", column.column); e_xml_set_bool_prop_by_name (new_node, "ascending", column.ascending); - node = new_node; } return grouping; diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index a1947cf74d..2122a015ca 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -682,7 +682,6 @@ static gboolean table_canvas_reflow_idle (ETable *e_table) { gdouble height, width; - gdouble item_height; gdouble oldheight, oldwidth; GtkAllocation *alloc = &(GTK_WIDGET (e_table->table_canvas)->allocation); @@ -690,7 +689,6 @@ table_canvas_reflow_idle (ETable *e_table) "height", &height, "width", &width, NULL); - item_height = height; height = MAX ((int)height, alloc->height); width = MAX((int)width, alloc->width); /* I have no idea why this needs to be -1, but it works. */ @@ -713,7 +711,6 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, { gdouble width; gdouble height; - gdouble item_height; GValue *val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_DOUBLE); @@ -722,7 +719,6 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, g_object_get (e_table->canvas_vbox, "height", &height, NULL); - item_height = height; height = MAX ((int)height, alloc->height); g_object_set (e_table->canvas_vbox, @@ -1139,9 +1135,6 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d static gboolean canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) { - GnomeCanvas *canvas; - - canvas = GNOME_CANVAS (etable->table_canvas); switch (key->keyval) { case GDK_Tab: case GDK_KP_Tab: @@ -1160,9 +1153,6 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) static gboolean click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) { - GnomeCanvas *canvas; - - canvas = GNOME_CANVAS (etable->table_canvas); switch (key->keyval) { case GDK_Tab: case GDK_KP_Tab: @@ -2463,9 +2453,9 @@ struct _GtkDragDestInfo GdkDragContext *context; /* Drag context */ GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */ GtkSelectionData *proxy_data; /* Set while retrieving proxied data */ - gboolean dropped : 1; /* Set after we receive a drop */ + guint dropped : 1; /* Set after we receive a drop */ guint32 proxy_drop_time; /* Timestamp for proxied drop */ - gboolean proxy_drop_wait : 1; /* Set if we are waiting for a + guint proxy_drop_wait : 1; /* Set if we are waiting for a * status reply before sending * a proxied drop on. */ @@ -2847,9 +2837,6 @@ do_drag_motion(ETable *et, { gboolean ret_val; int row = -1, col = -1; - GtkWidget *widget; - - widget = GTK_WIDGET (et); e_table_get_cell_at (et, x, y, &row, &col); @@ -3060,11 +3047,9 @@ e_table_class_init (ETableClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - GtkContainerClass *container_class; object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; - container_class = (GtkContainerClass *) class; parent_class = g_type_class_peek_parent (class); diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c index 288769e4bc..953009ea1e 100644 --- a/widgets/table/e-tree-scrolled.c +++ b/widgets/table/e-tree-scrolled.c @@ -204,11 +204,9 @@ e_tree_scrolled_class_init (ETreeScrolledClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - GtkContainerClass *container_class; object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; - container_class = (GtkContainerClass *) class; parent_class = g_type_class_ref (PARENT_TYPE); diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 6bf82ede38..4514a7b15e 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -982,13 +982,13 @@ set_collapsed_state_func (gpointer keyp, gpointer value, gpointer data) ETreePath path = keyp; node_t *node = ((GNode *)value)->data; ETreeTableAdapter *etta = (ETreeTableAdapter *) data; - xmlNode *xmlnode; if (node->expanded != FALSE) { e_tree_table_adapter_node_set_expanded(etta, path, FALSE); node->expanded = FALSE; } } + void e_tree_table_adapter_load_all_expanded_state (ETreeTableAdapter *etta, gboolean state) { diff --git a/widgets/table/e-tree-table-adapter.h b/widgets/table/e-tree-table-adapter.h index fdcbf2335c..2cc4f88e25 100644 --- a/widgets/table/e-tree-table-adapter.h +++ b/widgets/table/e-tree-table-adapter.h @@ -71,6 +71,8 @@ void e_tree_table_adapter_node_set_expanded (ETreeTableAdapter void e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePath path, gboolean expanded); +void e_tree_table_adapter_load_all_expanded_state (ETreeTableAdapter *etta, + gboolean state); void e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible); ETreePath e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 9ba6f7f5f2..afbb484964 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -713,7 +713,6 @@ static gboolean tree_canvas_reflow_idle (ETree *e_tree) { gdouble height, width; - gdouble item_height; gdouble oldheight, oldwidth; GtkAllocation *alloc = &(GTK_WIDGET (e_tree->priv->table_canvas)->allocation); @@ -721,7 +720,6 @@ tree_canvas_reflow_idle (ETree *e_tree) "height", &height, "width", &width, NULL); - item_height = height; height = MAX ((int)height, alloc->height); width = MAX((int)width, alloc->width); /* I have no idea why this needs to be -1, but it works. */ @@ -744,7 +742,6 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, { gdouble width; gdouble height; - gdouble item_height; GtkAdjustment *adj = GTK_LAYOUT(e_tree->priv->table_canvas)->vadjustment; ETreePath path = e_tree_get_cursor (e_tree); gint x, y, w, h; @@ -756,7 +753,6 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, g_object_get (e_tree->priv->item, "height", &height, NULL); - item_height = height; height = MAX ((int)height, alloc->height); g_object_set (e_tree->priv->item, @@ -2205,9 +2201,9 @@ struct _GtkDragDestInfo GdkDragContext *context; /* Drag context */ GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */ GtkSelectionData *proxy_data; /* Set while retrieving proxied data */ - gboolean dropped : 1; /* Set after we receive a drop */ + guint dropped : 1; /* Set after we receive a drop */ guint32 proxy_drop_time; /* Timestamp for proxied drop */ - gboolean proxy_drop_wait : 1; /* Set if we are waiting for a + guint proxy_drop_wait : 1; /* Set if we are waiting for a * status reply before sending * a proxied drop on. */ @@ -2252,12 +2248,9 @@ e_tree_drag_get_data (ETree *tree, GdkAtom target, guint32 time) { - ETreePath path; g_return_if_fail(tree != NULL); g_return_if_fail(E_IS_TREE(tree)); - path = e_tree_table_adapter_node_at_row(tree->priv->etta, row); - gtk_drag_get_data(GTK_WIDGET(tree), context, target, @@ -2633,9 +2626,6 @@ do_drag_motion(ETree *et, gboolean ret_val = FALSE; int row, col; ETreePath path; - GtkWidget *widget; - - widget = GTK_WIDGET (et); e_tree_get_cell_at (et, x, @@ -3008,11 +2998,9 @@ e_tree_class_init (ETreeClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; - GtkContainerClass *container_class; object_class = (GObjectClass *) class; widget_class = (GtkWidgetClass *) class; - container_class = (GtkContainerClass *) class; parent_class = g_type_class_ref (PARENT_TYPE); diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index d4057b0ae6..f244715c9a 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -289,6 +289,7 @@ void e_tree_load_expanded_state (ETree *et, char *filename); int e_tree_row_count (ETree *et); GtkWidget *e_tree_get_tooltip (ETree *et); +void e_tree_load_all_expanded_state (ETree *et, gboolean state); typedef enum { E_TREE_FIND_NEXT_BACKWARD = 0, |