[evolution-patches] Cleanups for evolution/widgets/table



More of the same.

There's a check for eti->frozen_count > 0 added there that showed up as
a CRITICAL warning some time back too and is filed in bugzilla as
http://bugzilla.gnome.org/show_bug.cgi?id=323522 Not sure that is the
right fix, but it's there all the same.

Cheers
Kjartan

? .warnings.swp
? warnings
Index: e-cell-text.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-cell-text.c,v
retrieving revision 1.153
diff -u -p -r1.153 e-cell-text.c
--- e-cell-text.c	24 Aug 2006 01:07:50 -0000	1.153
+++ e-cell-text.c	29 Aug 2006 20:51:03 -0000
@@ -583,8 +583,8 @@ build_layout (ECellTextView *text_view, 
 	if (ect->font_name)
 	{
 		PangoFontDescription *desc = NULL, *fixed_desc = NULL;
-		char *fixed_family = NULL;
-		gint fixed_size;
+		const char *fixed_family = NULL;
+		gint fixed_size = 0;
 		
 		fixed_desc = pango_font_description_from_string (ect->font_name);
 		if (fixed_desc) {
@@ -1332,7 +1332,7 @@ ect_print (ECellView *ecell_view, GnomeP
 	PangoFontMetrics *font_metrics;
 	char *string;
 	ECellText *ect = E_CELL_TEXT(ecell_view->ecell);
-	double ty, ly, text_width, text_height;
+	double ty, ly, text_width = 0, text_height = 0;
 	ECellTextView *ectView = (ECellTextView *)ecell_view;
 	GtkWidget *canvas = GTK_WIDGET(ectView->canvas); 
 	PangoDirection dir;
Index: e-table-header-item.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-header-item.c,v
retrieving revision 1.136
diff -u -p -r1.136 e-table-header-item.c
--- e-table-header-item.c	12 Jun 2006 05:05:48 -0000	1.136
+++ e-table-header-item.c	29 Aug 2006 20:51:03 -0000
@@ -975,7 +975,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDra
 		for (i = 0; i < length; i++) {
 			ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i);
 			g_hash_table_insert (arrows, 
-					     GINT_TO_POINTER (column.column),
+					     GINT_TO_POINTER ((int)column.column),
 					     GINT_TO_POINTER (column.ascending ?
 							      E_TABLE_COL_ARROW_DOWN : 
 							      E_TABLE_COL_ARROW_UP));
@@ -984,7 +984,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDra
 		for (i = 0; i < length; i++) {
 			ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i);
 			g_hash_table_insert (arrows, 
-					     GINT_TO_POINTER (column.column),
+					     GINT_TO_POINTER ((int)column.column),
 					     GINT_TO_POINTER (column.ascending ?
 							      E_TABLE_COL_ARROW_DOWN : 
 							      E_TABLE_COL_ARROW_UP));
@@ -1173,7 +1173,7 @@ ethi_start_drag (ETableHeaderItem *ethi,
 			group_indent ++;
 			g_hash_table_insert (
 				arrows, 
-				GINT_TO_POINTER (column.column),
+				GINT_TO_POINTER ((int)column.column),
 				GINT_TO_POINTER (column.ascending ?
 						 E_TABLE_COL_ARROW_DOWN : 
 						 E_TABLE_COL_ARROW_UP));
@@ -1186,7 +1186,7 @@ ethi_start_drag (ETableHeaderItem *ethi,
 
 			g_hash_table_insert (
 				arrows, 
-				GINT_TO_POINTER (column.column),
+				GINT_TO_POINTER ((int)column.column),
 				GINT_TO_POINTER (column.ascending ?
 						 E_TABLE_COL_ARROW_DOWN : 
 						 E_TABLE_COL_ARROW_UP));
@@ -1509,10 +1509,10 @@ static EPopupMenu ethi_context_menu [] =
 static void
 sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi)
 {
-	int col = GPOINTER_TO_INT (g_object_get_data(menu_item, "col-number"));
+	int col = GPOINTER_TO_INT (g_object_get_data(G_OBJECT (menu_item), "col-number"));
 	ETableCol *ecol;
 
-	if (!gtk_check_menu_item_get_active(menu_item))
+	if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menu_item)))
 		return;
 	
 	ecol = e_table_header_get_column (ethi->full_header, col);
@@ -1522,7 +1522,7 @@ sort_by_id (GtkWidget *menu_item, ETable
 static void
 popup_custom (GtkWidget *menu_item, EthiHeaderInfo *info)
 {
-	if (!gtk_check_menu_item_get_active(menu_item))
+	if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menu_item)))
 		return;
 
 	ethi_popup_customize_view(menu_item, info);
@@ -1532,12 +1532,13 @@ ethi_header_context_menu (ETableHeaderIt
 {
 	EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1);
 	ETableCol *col;
-	GtkMenu *popup, *sub_menu;;
+	GtkMenu *popup;
+	GtkWidget *sub_menu;
 	int ncol, sort_count, sort_col;
 	GtkWidget *menu_item;
 	GSList *group = NULL;
 	ETableSortColumn column;
-	gboolean ascending;
+	gboolean ascending = FALSE;
 	
 	info->ethi = ethi;
 	info->col = ethi_find_col_by_x (ethi, event->x);
@@ -1552,10 +1553,10 @@ ethi_header_context_menu (ETableHeaderIt
 						 128, info, E_I18N_DOMAIN);
 	
 	menu_item = gtk_menu_item_new_with_label (_("Sort By"));
-	gtk_widget_show (menu_item);
+	gtk_widget_show (GTK_WIDGET (menu_item));
 	sub_menu = gtk_menu_new ();
 	gtk_widget_show (sub_menu);
-	gtk_menu_item_set_submenu (menu_item, sub_menu);
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), sub_menu);
 	gtk_menu_shell_prepend (GTK_MENU_SHELL (popup), menu_item);
 
 	sort_count = e_table_sort_info_sorting_get_count(ethi->sort_info);
@@ -1601,7 +1602,7 @@ ethi_header_context_menu (ETableHeaderIt
 		
 		if (ncol == sort_col)
 			gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
-		g_object_set_data (menu_item, "col-number", GINT_TO_POINTER (ncol));
+		g_object_set_data (G_OBJECT (menu_item), "col-number", GINT_TO_POINTER (ncol));
 		g_signal_connect (menu_item, "activate", G_CALLBACK (sort_by_id), ethi);
 	}
 	
Index: e-table-header-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-header-utils.c,v
retrieving revision 1.23
diff -u -p -r1.23 e-table-header-utils.c
--- e-table-header-utils.c	12 Jun 2006 09:43:54 -0000	1.23
+++ e-table-header-utils.c	29 Aug 2006 20:51:03 -0000
@@ -350,7 +350,7 @@ e_table_header_draw_button (GdkDrawable 
 		gtk_widget_ensure_style (window);
 		gtk_widget_ensure_style (button);
 		g_label = GTK_BIN(button)->child;
-		g_object_add_weak_pointer (G_OBJECT (g_label), &g_label);
+		g_object_add_weak_pointer (G_OBJECT (g_label), (gpointer)&g_label);
 		gtk_widget_ensure_style (g_label);
 	}
 
Index: e-table-item.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-item.c,v
retrieving revision 1.247
diff -u -p -r1.247 e-table-item.c
--- e-table-item.c	2 Mar 2006 05:39:57 -0000	1.247
+++ e-table-item.c	29 Aug 2006 20:51:03 -0000
@@ -33,6 +33,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+
+#include <glib-object.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
@@ -1109,7 +1111,8 @@ eti_table_model_changed (ETableModel *ta
 
 	free_height_cache(eti);
 
-	eti_unfreeze (eti);
+	if (eti->frozen_count > 0)
+		eti_unfreeze (eti);
 
 	eti->needs_compute_height = 1;
 	e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
@@ -1668,11 +1671,11 @@ adjustment_changed (GtkAdjustment *adjus
 }
 
 static gboolean
-eti_tree_unfreeze (GtkWidget *widget,  GdkEvent *event, ETableItem *eti)
+eti_tree_unfreeze (GObject *object,  GdkEvent *event, ETableItem *eti)
 {
 
-	if (widget)
-		g_object_set_data (widget, "freeze-cursor", 0);
+	if (object)
+		g_object_set_data (object, "freeze-cursor", NULL);
 
 	return FALSE;
 }
Index: e-tree-table-adapter.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-tree-table-adapter.c,v
retrieving revision 1.64
diff -u -p -r1.64 e-tree-table-adapter.c
--- e-tree-table-adapter.c	18 Aug 2006 18:50:11 -0000	1.64
+++ e-tree-table-adapter.c	29 Aug 2006 20:51:03 -0000
@@ -746,7 +746,7 @@ etta_proxy_no_change (ETreeModel *etm, E
 	e_table_model_no_change(E_TABLE_MODEL(etta));
 }
 
-guint resort_model (ETreeTableAdapter *etta)
+static guint resort_model (ETreeTableAdapter *etta)
 {
 	etta_sort_info_changed (NULL, etta);
 	return FALSE;
@@ -761,7 +761,7 @@ etta_proxy_node_changed (ETreeModel *etm
 	/* FIXME: Really it shouldnt be required. But a lot of thread
 	 * which were supposed to be present in the list is way below
 	 */
-	g_idle_add (resort_model, etta);
+	g_idle_add ((GSourceFunc)resort_model, etta);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]