summaryrefslogtreecommitdiff
path: root/gtk/gtkfontbutton.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2011-09-05 22:45:44 +0200
committerChristian Persch <chpe@gnome.org>2011-09-13 12:55:22 +0200
commit0b7db6888a5377e0635449fa79d88df1df22a7b4 (patch)
treebaf99d11eaeeba767cc6374a0409ac6d6167d7b7 /gtk/gtkfontbutton.c
parentcf1486861929e9ed46e5161ecab6f2eeeaecf457 (diff)
downloadgtk+-0b7db6888a5377e0635449fa79d88df1df22a7b4.tar.gz
Setters should not return a boolean
The setter for the "font" property returned a boolean that indicated whether the given font has been found. Instead, fall back to the default font name when the given font doesn't exist.
Diffstat (limited to 'gtk/gtkfontbutton.c')
-rw-r--r--gtk/gtkfontbutton.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 7492a9a5de..dc0fde66b7 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -201,13 +201,13 @@ gtk_font_button_font_chooser_get_font (GtkFontChooser *chooser)
return g_strdup (gtk_font_button_get_font_name (font_button));
}
-static gboolean
+static void
gtk_font_button_font_chooser_set_font (GtkFontChooser *chooser,
const gchar *fontname)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
- return gtk_font_button_set_font_name (font_button, fontname);
+ gtk_font_button_set_font_name (font_button, fontname);
}
static PangoFontFamily *
@@ -873,7 +873,6 @@ gboolean
gtk_font_button_set_font_name (GtkFontButton *font_button,
const gchar *fontname)
{
- gboolean result;
gchar *old_fontname;
g_return_val_if_fail (GTK_IS_FONT_BUTTON (font_button), FALSE);
@@ -889,15 +888,13 @@ gtk_font_button_set_font_name (GtkFontButton *font_button,
gtk_font_button_update_font_info (font_button);
if (font_button->priv->font_dialog)
- result = gtk_font_chooser_set_font (GTK_FONT_CHOOSER (font_button->priv->font_dialog),
- font_button->priv->fontname);
- else
- result = FALSE;
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (font_button->priv->font_dialog),
+ font_button->priv->fontname);
g_object_notify (G_OBJECT (font_button), "font");
g_object_notify (G_OBJECT (font_button), "font-name");
- return result;
+ return TRUE;
}
static void