From 6ca945f3349a0a4346401b740a99b42725570239 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sun, 31 Jan 2010 20:22:02 +0100 Subject: [PATCH] Fix compiler warnings for hildon-extras dialogs --- src/he/he-about-dialog.c | 6 +++--- src/he/he-simple-color-dialog.c | 26 +++++--------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/he/he-about-dialog.c b/src/he/he-about-dialog.c index 921e0c8..d31eb6c 100644 --- a/src/he/he-about-dialog.c +++ b/src/he/he-about-dialog.c @@ -146,7 +146,7 @@ he_about_dialog_init (HeAboutDialog *ad) ad->priv->donate_url = NULL; gchar* title = NULL; - gchar* app_name = NULL; + const gchar* app_name = NULL; app_name = g_get_application_name(); @@ -203,7 +203,7 @@ he_about_dialog_init (HeAboutDialog *ad) static void he_about_dialog_finalize (GObject * object) { - HeAboutDialogPrivate *priv = HE_ABOUT_DIALOG_GET_PRIVATE (object); + /*HeAboutDialogPrivate *priv = HE_ABOUT_DIALOG_GET_PRIVATE (object);*/ if (G_OBJECT_CLASS (parent_class)->finalize) G_OBJECT_CLASS (parent_class)->finalize (object); @@ -275,7 +275,7 @@ he_about_dialog_present(const gchar* app_name, const gchar* bugtracker_url, const gchar* donate_url) { - HeAboutDialog* ad = he_about_dialog_new(); + HeAboutDialog* ad = HE_ABOUT_DIALOG(he_about_dialog_new()); if (app_name != NULL) { he_about_dialog_set_app_name(ad, app_name); diff --git a/src/he/he-simple-color-dialog.c b/src/he/he-simple-color-dialog.c index f37e886..8bf4883 100644 --- a/src/he/he-simple-color-dialog.c +++ b/src/he/he-simple-color-dialog.c @@ -141,7 +141,7 @@ he_simple_color_dialog_show (GtkWidget *widget) static void he_simple_color_dialog_destroy (GtkObject *object) { - HeSimpleColorDialogPrivate *priv = HE_SIMPLE_COLOR_DIALOG_GET_PRIVATE (object); + /*HeSimpleColorDialogPrivate *priv = HE_SIMPLE_COLOR_DIALOG_GET_PRIVATE (object);*/ GTK_OBJECT_CLASS (parent_class)->destroy (object); } @@ -197,7 +197,7 @@ he_simple_color_dialog_init (HeSimpleColorDialog *ad) gtk_window_set_title(GTK_WINDOW(ad), _("Select a color")); /* Create table and insert color chooser buttons */ - GtkTable* t = gtk_table_new(PALETTE_SIZE/3, 3, FALSE); + GtkTable* t = GTK_TABLE(gtk_table_new(PALETTE_SIZE/3, 3, FALSE)); for (i=0; ipriv->buttons[i] = hildon_gtk_toggle_button_new(HILDON_SIZE_THUMB_HEIGHT); @@ -215,7 +215,7 @@ he_simple_color_dialog_init (HeSimpleColorDialog *ad) 0 /* ypadding */); } - ad->priv->table_layout = t; + ad->priv->table_layout = GTK_WIDGET(t); GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(ad)); gtk_container_add(GTK_CONTAINER(content_area), GTK_WIDGET(t)); @@ -224,7 +224,6 @@ he_simple_color_dialog_init (HeSimpleColorDialog *ad) /* By default, toggle the first button */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ad->priv->buttons[0]), TRUE); - g_signal_connect(G_OBJECT(ad), "response", G_CALLBACK(he_simple_color_dialog_response), ad); gtk_widget_show_all(GTK_WIDGET(ad)); /* Hide the "custom color" button */ @@ -237,28 +236,13 @@ he_simple_color_dialog_init (HeSimpleColorDialog *ad) static void he_simple_color_dialog_finalize (GObject * object) { - HeSimpleColorDialogPrivate *priv = HE_SIMPLE_COLOR_DIALOG_GET_PRIVATE (object); + /*HeSimpleColorDialogPrivate *priv = HE_SIMPLE_COLOR_DIALOG_GET_PRIVATE (object);*/ if (G_OBJECT_CLASS (parent_class)->finalize) G_OBJECT_CLASS (parent_class)->finalize (object); } /* ------------------------------ PRIVATE METHODS ---------------------------- */ -void -he_simple_color_dialog_response (GtkDialog *dialog, gint response_id, HeSimpleColorDialog* ad) -{ - HeSimpleColorDialogPrivate *priv = HE_SIMPLE_COLOR_DIALOG_GET_PRIVATE (ad); - - switch (response_id) { - case GTK_RESPONSE_OK: - /* TODO */ - break; - default: - /* Dialog closed - do nothing */ - break; - } -} - /* ------------------------------ PUBLIC METHODS ---------------------------- */ @@ -312,7 +296,7 @@ he_simple_color_dialog_set_color(HeSimpleColorDialog* scd, GdkColor* color) GdkColor* he_simple_color_dialog_get_color(HeSimpleColorDialog* scd) { - g_return_if_fail (HE_IS_SIMPLE_COLOR_DIALOG(scd)); + g_assert(HE_IS_SIMPLE_COLOR_DIALOG(scd)); return gdk_color_copy(&(scd->priv->palette[scd->priv->color_index])); } -- 2.11.4.GIT