[libgda] Fix some more compiler warnings.



commit 431bcc27779cd53f1d83f2355680bea407014424
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jul 20 09:37:43 2011 +0200

    Fix some more compiler warnings.
    
    * libgda/gda-data-model.c: (gda_data_model_set_values): Fix a
      signed/unsigned warning.
    * libgda-ui/data-entries/gdaui-entry-bin.c: (popup_position):
      Remove the call to deprecated
      gtk_widget_size_request() because the result is not used
      anyway.
    * libgda-ui/data-entries/gdaui-entry-common-time.c:
      (position_popup): Replace use of deprecated
      gtk_widget_size_request() with gtk_widget_get_preferred_size().
    * libgda-ui/data-entries/widget-embedder.c: (widget_embedder_realize):
      Use GtkStyleContext instead of deprecated GtkStyle.
      (widget_embedder_size_allocate): Remove the call to deprecated
      gtk_widget_get_child_requisition() because the result is not used
      anyway.

 libgda-ui/data-entries/gdaui-entry-bin.c         |    4 ----
 libgda-ui/data-entries/gdaui-entry-common-time.c |    7 ++++---
 libgda-ui/data-entries/widget-embedder.c         |   12 ++++--------
 libgda/gda-data-model.c                          |    2 +-
 4 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-bin.c b/libgda-ui/data-entries/gdaui-entry-bin.c
index a7cb468..e00203d 100644
--- a/libgda-ui/data-entries/gdaui-entry-bin.c
+++ b/libgda-ui/data-entries/gdaui-entry-bin.c
@@ -328,10 +328,6 @@ popup_position (PopupContainer *container, gint *out_x, gint *out_y)
 	poswidget = g_object_get_data (G_OBJECT (container), "__poswidget");
 
 	gint x, y;
-        GtkRequisition req;
-
-        gtk_widget_size_request (poswidget, &req);
-
         gdk_window_get_origin (gtk_widget_get_window (poswidget), &x, &y);
 	GtkAllocation alloc;
 	gtk_widget_get_allocation (poswidget, &alloc);
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index e17df82..0e71c1e 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -965,9 +965,10 @@ position_popup (GdauiEntryCommonTime *mgtim)
 {
         gint x, y;
         gint bwidth, bheight;
-        GtkRequisition req;
+        GtkRequisition req_minimum, req_natural;
 
-        gtk_widget_size_request (mgtim->priv->window, &req);
+        gtk_widget_get_preferred_size (mgtim->priv->window, &req_minimum,
+                &req_natural);
 
         gdk_window_get_origin (gtk_widget_get_window (mgtim->priv->date_button), &x, &y);
 	GtkAllocation alloc;
@@ -977,7 +978,7 @@ position_popup (GdauiEntryCommonTime *mgtim)
         bwidth = alloc.width;
         bheight = alloc.height;
 
-        x += bwidth - req.width;
+        x += bwidth - req_natural.width;
         y += bheight;
 
         if (x < 0)
diff --git a/libgda-ui/data-entries/widget-embedder.c b/libgda-ui/data-entries/widget-embedder.c
index a79638e..7ede546 100644
--- a/libgda-ui/data-entries/widget-embedder.c
+++ b/libgda-ui/data-entries/widget-embedder.c
@@ -210,13 +210,11 @@ widget_embedder_realize (GtkWidget *widget)
 	g_signal_connect (bin->offscreen_window, "from-embedder",
 			  G_CALLBACK (offscreen_window_from_parent), bin);
 
-	GtkStyle *style;
-	style = gtk_widget_get_style (widget);
-	style = gtk_style_attach (style, win);
-	gtk_widget_set_style (widget, style);
+	GtkStyleContext *style;
+	style = gtk_widget_get_style_context (widget);
 
-	gtk_style_set_background (style, win, GTK_STATE_NORMAL);
-	gtk_style_set_background (style, bin->offscreen_window, GTK_STATE_NORMAL);
+	gtk_style_context_set_background (style, win);
+	gtk_style_context_set_background (style, bin->offscreen_window);
 	gdk_window_show (bin->offscreen_window);
 }
 
@@ -355,10 +353,8 @@ widget_embedder_size_allocate (GtkWidget     *widget,
 	}
 
 	if (bin->child && gtk_widget_get_visible (bin->child)){
-		GtkRequisition child_requisition;
 		GtkAllocation child_allocation;
 		
-		gtk_widget_get_child_requisition (bin->child, &child_requisition);
 		child_allocation.x = 0;
 		child_allocation.y = 0;
 		child_allocation.height = h;
diff --git a/libgda/gda-data-model.c b/libgda/gda-data-model.c
index 0d20057..ff5708c 100644
--- a/libgda/gda-data-model.c
+++ b/libgda/gda-data-model.c
@@ -780,7 +780,7 @@ gda_data_model_set_values (GdaDataModel *model, gint row, GList *values, GError
 		/* save the values */
 		gint col, ncols;
 		ncols = gda_data_model_get_n_columns (model);
-		if (g_list_length (values) > ncols) {
+		if ((gint)g_list_length (values) > ncols) {
 			g_set_error (error, GDA_DATA_MODEL_ERROR,  GDA_DATA_MODEL_VALUES_LIST_ERROR,
 				     "%s", _("Too many values in list"));
 			return FALSE;



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