Improve GSettings usage
Submitted by Danielle Madeley
Link to original bug (#621338)
Description
There are a number of places in Empathy where a GSettings changed:: signal is being used to update the toggled/sensitive/etc. of a GtkWidget. These instances should be identified and replaced with uses of g_settings_bind()
This is the pattern to look for:
static void notify_cb (GSettings *gsettings, ...) { gtk_toggle_button_set_active (toggle_button, g_settings_get_boolean (gsettings, key)); }
construct_ui (...) { g_signal_connect (gsettings, "changed::" SOME_KEY_NAME, G_CALLBACK (notify_cb), something); notify_cb (gsettings, SOME_KEY_NAME, something); }
It can be replaced by:
g_settings_bind (gsettings, key, widget, "property", G_SETTINGS_BIND_GET);
Version: 2.31.x