[gtk+] Rename gtk_application_window_get_observer
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Rename gtk_application_window_get_observer
- Date: Wed, 11 Jan 2012 05:31:38 +0000 (UTC)
commit ab9152703221fcd2fd31d632fcbce2928bb7d1a3
Author: Ryan Lortie <desrt desrt ca>
Date: Mon Jan 9 15:18:28 2012 +0100
Rename gtk_application_window_get_observer
This should have been called _create_observer
https://bugzilla.gnome.org/show_bug.cgi?id=667394
Fixup switch
gtk/gtkapplicationprivate.h | 2 +-
gtk/gtkapplicationwindow.c | 6 +++---
gtk/gtkbutton.c | 6 +++---
gtk/gtkswitch.c | 20 ++++++++------------
4 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkapplicationprivate.h b/gtk/gtkapplicationprivate.h
index 4ff3b2b..b2b9b9c 100644
--- a/gtk/gtkapplicationprivate.h
+++ b/gtk/gtkapplicationprivate.h
@@ -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);
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index cb073f3..d8538c3 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -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);
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index f6474f3..cc159c4 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -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));
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index e67fce6..57d81e0 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]