[devhelp] Fonts handling: remove the two params for the ::fonts-changed signal



commit c496669953418cf461c5eda2ac9859d4ab45fa22
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri May 11 20:31:35 2018 +0200

    Fonts handling: remove the two params for the ::fonts-changed signal
    
    The simpler code the better.

 src/dh-settings-app.c |   22 +++++-----------------
 src/dh-settings-app.h |    4 +---
 src/dh-web-view.c     |    2 --
 3 files changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/src/dh-settings-app.c b/src/dh-settings-app.c
index d5a68b3..bf946f6 100644
--- a/src/dh-settings-app.c
+++ b/src/dh-settings-app.c
@@ -89,27 +89,15 @@ dh_settings_app_class_init (DhSettingsAppClass *klass)
                               G_SIGNAL_RUN_LAST,
                               G_STRUCT_OFFSET (DhSettingsAppClass, fonts_changed),
                               NULL, NULL, NULL,
-                              G_TYPE_NONE,
-                              2,
-                              G_TYPE_STRING,
-                              G_TYPE_STRING);
+                              G_TYPE_NONE, 0);
 }
 
 static void
-fonts_changed_cb (GSettings *gsettings,
-                  gchar     *key,
-                  gpointer   user_data)
+fonts_changed_cb (GSettings     *gsettings,
+                  gchar         *key,
+                  DhSettingsApp *self)
 {
-        DhSettingsApp *self = DH_SETTINGS_APP (user_data);
-        gchar *fixed_font = NULL;
-        gchar *variable_font = NULL;
-
-        dh_settings_app_get_selected_fonts (self, &fixed_font, &variable_font);
-
-        g_signal_emit (self, signals[FONTS_CHANGED], 0, fixed_font, variable_font);
-
-        g_free (fixed_font);
-        g_free (variable_font);
+        g_signal_emit (self, signals[FONTS_CHANGED], 0);
 }
 
 static void
diff --git a/src/dh-settings-app.h b/src/dh-settings-app.h
index edf0366..6f086ee 100644
--- a/src/dh-settings-app.h
+++ b/src/dh-settings-app.h
@@ -46,9 +46,7 @@ struct _DhSettingsAppClass {
         GObjectClass parent;
 
         /* Signals */
-        void (*fonts_changed) (DhSettingsApp *settings,
-                               const gchar   *font_name_fixed,
-                               const gchar   *font_name_variable);
+        void (*fonts_changed) (DhSettingsApp *settings);
 };
 
 GType           dh_settings_app_get_type                    (void);
diff --git a/src/dh-web-view.c b/src/dh-web-view.c
index 8b99918..071254d 100644
--- a/src/dh-web-view.c
+++ b/src/dh-web-view.c
@@ -156,8 +156,6 @@ update_fonts (DhWebView *view)
 
 static void
 settings_fonts_changed_cb (DhSettingsApp *settings,
-                           const gchar   *font_name_fixed,
-                           const gchar   *font_name_variable,
                            DhWebView     *view)
 {
         update_fonts (view);


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