[gnome-text-editor] gsettings: use change-event for signal dispatch
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] gsettings: use change-event for signal dispatch
- Date: Mon, 7 Feb 2022 18:45:32 +0000 (UTC)
commit 4292637b163e20c3327863fc40bf98ca9612ec5f
Author: Christian Hergert <chergert redhat com>
Date: Mon Feb 7 10:45:27 2022 -0800
gsettings: use change-event for signal dispatch
This only gets emitted once for the group of changes, so we can do fewer
updates in a group update scenario. Furthermore, it's more likely to get
emitted than the other case.
src/editor-page-gsettings.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/editor-page-gsettings.c b/src/editor-page-gsettings.c
index 6c15d3b..ec99481 100644
--- a/src/editor-page-gsettings.c
+++ b/src/editor-page-gsettings.c
@@ -100,9 +100,10 @@ editor_page_gsettings_get_custom_font (EditorPageSettingsProvider *provider,
}
static void
-editor_page_gsettings_changed_cb (EditorPageGsettings *self,
- const gchar *key,
- GSettings *settings)
+editor_page_gsettings_change_event_cb (EditorPageGsettings *self,
+ gpointer keys,
+ int n_keys,
+ GSettings *settings)
{
g_assert (EDITOR_IS_PAGE_GSETTINGS (self));
g_assert (G_IS_SETTINGS (settings));
@@ -142,7 +143,7 @@ editor_page_gsettings_dispose (GObject *object)
if (self->settings != NULL)
{
g_signal_handlers_disconnect_by_func (self->settings,
- G_CALLBACK (editor_page_gsettings_changed_cb),
+ G_CALLBACK (editor_page_gsettings_change_event_cb),
self);
g_clear_object (&self->settings);
}
@@ -185,8 +186,8 @@ _editor_page_gsettings_new (GSettings *settings)
self->settings = g_object_ref (settings);
g_signal_connect_object (self->settings,
- "changed",
- G_CALLBACK (editor_page_gsettings_changed_cb),
+ "change-event",
+ G_CALLBACK (editor_page_gsettings_change_event_cb),
self,
G_CONNECT_SWAPPED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]