Commit ab915270 authored by Allison Karlitskaya's avatar Allison Karlitskaya Committed by Matthias Clasen

Rename gtk_application_window_get_observer

This should have been called _create_observer

https://bugzilla.gnome.org/show_bug.cgi?id=667394

Fixup switch
parent bec43213
......@@ -35,7 +35,7 @@ G_GNUC_INTERNAL
void gtk_application_window_unpublish (GtkApplicationWindow *window);
G_GNUC_INTERNAL
GSimpleActionObserver * gtk_application_window_get_observer (GtkApplicationWindow *window,
GSimpleActionObserver * gtk_application_window_create_observer (GtkApplicationWindow *window,
const gchar *action_name,
GVariant *target);
......
......@@ -984,9 +984,9 @@ gtk_application_window_set_show_menubar (GtkApplicationWindow *window,
}
GSimpleActionObserver *
gtk_application_window_get_observer (GtkApplicationWindow *window,
const gchar *action_name,
GVariant *target)
gtk_application_window_create_observer (GtkApplicationWindow *window,
const gchar *action_name,
GVariant *target)
{
g_return_val_if_fail (GTK_IS_APPLICATION_WINDOW (window), NULL);
......
......@@ -709,9 +709,9 @@ gtk_button_update_action_observer (GtkButton *button)
{
GSimpleActionObserver *observer;
observer = gtk_application_window_get_observer (GTK_APPLICATION_WINDOW (window),
button->priv->action_name,
button->priv->action_target);
observer = gtk_application_window_create_observer (GTK_APPLICATION_WINDOW (window),
button->priv->action_name,
button->priv->action_target);
_gtk_button_set_depressed (button, g_simple_action_observer_get_active (observer));
......
......@@ -713,12 +713,11 @@ gtk_switch_update_action_observer (GtkSwitch *sw)
{
GSimpleActionObserver *observer;
observer = gtk_application_window_get_observer (GTK_APPLICATION_WINDOW (window),
sw->priv->action_name,
sw->priv->action_target);
observer = gtk_application_window_create_observer (GTK_APPLICATION_WINDOW (window),
sw->priv->action_name,
sw->priv->action_target);
if (g_object_class_find_property (G_OBJECT_GET_CLASS (sw), "active"))
g_object_bind_property (observer, "active", sw, "active", G_BINDING_SYNC_CREATE);
g_object_bind_property (observer, "active", sw, "active", G_BINDING_SYNC_CREATE);
g_object_bind_property (observer, "enabled", sw, "sensitive", G_BINDING_SYNC_CREATE);
sw->priv->action_observer = observer;
......@@ -733,15 +732,12 @@ gtk_switch_set_action_name (GtkActionable *actionable,
g_return_if_fail (GTK_IS_SWITCH (sw));
if (g_strcmp0 (action_name, sw->priv->action_name) != 0)
{
g_free (sw->priv->action_name);
sw->priv->action_name = g_strdup (action_name);
g_free (sw->priv->action_name);
sw->priv->action_name = g_strdup (action_name);
gtk_switch_update_action_observer (sw);
gtk_switch_update_action_observer (sw);
g_object_notify (G_OBJECT (sw), "action-name");
}
g_object_notify (G_OBJECT (sw), "action-name");
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment