[totem] main: Replace deprecated gtk_font_button_get|set_name()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Replace deprecated gtk_font_button_get|set_name()
- Date: Mon, 7 Oct 2019 10:13:27 +0000 (UTC)
commit 899a341bab4ad3c69c539f57c4959307f720403c
Author: Gabor Karsay <gabor karsay gmx at>
Date: Sun Oct 6 23:35:35 2019 +0200
main: Replace deprecated gtk_font_button_get|set_name()
These calls have been deprecated since GTK 3.22.
Unlike its deprecated predecessor, gtk_font_chooser_get_font's result
has to be freed.
src/totem-preferences.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/totem-preferences.c b/src/totem-preferences.c
index d5926e5eb..825a08ec2 100644
--- a/src/totem-preferences.c
+++ b/src/totem-preferences.c
@@ -80,10 +80,11 @@ tpw_color_reset_clicked_cb (GtkButton *button, Totem *totem)
void
font_set_cb (GtkFontButton * fb, Totem * totem)
{
- const gchar *font;
+ gchar *font;
- font = gtk_font_button_get_font_name (fb);
+ font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fb));
g_settings_set_string (totem->settings, "subtitle-font", font);
+ g_free (font);
}
void
@@ -104,7 +105,7 @@ font_changed_cb (GSettings *settings, const gchar *key, TotemObject *totem)
item = GTK_FONT_BUTTON (POBJ ("font_sel_button"));
font = g_settings_get_string (settings, "subtitle-font");
- gtk_font_button_set_font_name (item, font);
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (item), font);
bacon_video_widget_set_subtitle_font (totem->bvw, font);
g_free (font);
}
@@ -299,7 +300,7 @@ totem_setup_preferences (Totem *totem)
_("Select Subtitle Font"));
font = g_settings_get_string (totem->settings, "subtitle-font");
if (*font != '\0') {
- gtk_font_button_set_font_name (GTK_FONT_BUTTON (item), font);
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (item), font);
bacon_video_widget_set_subtitle_font (totem->bvw, font);
}
g_free (font);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]