diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-06-23 14:42:57 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-06-23 16:35:17 -0400 |
commit | f2a8ddfecf0868fe381ce287205156a7db84729c (patch) | |
tree | c589937f22b765f5b8889b6afd1b06f34754ec4d /gtk/gtksidebarrow.c | |
parent | 9f27ee7f5abf49a20ac95d57b306ecd4294b49c6 (diff) | |
download | gtk+-f2a8ddfecf0868fe381ce287205156a7db84729c.tar.gz |
sidebarrow: Avoid object-valued properties
They tend to leak...as these do.
Diffstat (limited to 'gtk/gtksidebarrow.c')
-rw-r--r-- | gtk/gtksidebarrow.c | 74 |
1 files changed, 26 insertions, 48 deletions
diff --git a/gtk/gtksidebarrow.c b/gtk/gtksidebarrow.c index e56180c538..a5ff9ccaa0 100644 --- a/gtk/gtksidebarrow.c +++ b/gtk/gtksidebarrow.c @@ -70,8 +70,6 @@ enum PROP_MOUNT, PROP_SENSITIVE, PROP_PLACEHOLDER, - PROP_EJECT_BUTTON, - PROP_EVENT_BOX, LAST_PROP }; @@ -171,18 +169,6 @@ gtk_sidebar_row_get_property (GObject *object, break; } - case PROP_EJECT_BUTTON: - { - g_value_set_object (value, self->eject_button); - break; - } - - case PROP_EVENT_BOX: - { - g_value_set_object (value, self->event_box); - break; - } - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -576,26 +562,6 @@ gtk_sidebar_row_class_init (GtkSidebarRowClass *klass) g_object_class_install_property (object_class, PROP_PLACEHOLDER, gParamSpecs [PROP_PLACEHOLDER]); - gParamSpecs [PROP_EJECT_BUTTON] = - g_param_spec_object ("eject-button", - "Eject Button", - "Eject button", - GTK_TYPE_WIDGET, - (G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (object_class, PROP_EJECT_BUTTON, - gParamSpecs [PROP_EJECT_BUTTON]); - - gParamSpecs [PROP_EVENT_BOX] = - g_param_spec_object ("event-box", - "Event Box", - "Event Box", - GTK_TYPE_WIDGET, - (G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (object_class, PROP_EVENT_BOX, - gParamSpecs [PROP_EVENT_BOX]); - gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/ui/gtksidebarrow.ui"); @@ -612,18 +578,30 @@ gtk_sidebar_row_class_init (GtkSidebarRowClass *klass) GtkSidebarRow* gtk_sidebar_row_clone (GtkSidebarRow *self) { - return g_object_new (GTK_TYPE_SIDEBAR_ROW, - "sidebar", self->sidebar, - "icon", self->icon, - "label", self->label, - "tooltip", self->tooltip, - "ejectable", self->ejectable, - "order-index", self->order_index, - "section-type", self->section_type, - "place-type", self->place_type, - "uri", self->uri, - "drive", self->drive, - "volume", self->volume, - "mount", self->mount, - NULL); + return g_object_new (GTK_TYPE_SIDEBAR_ROW, + "sidebar", self->sidebar, + "icon", self->icon, + "label", self->label, + "tooltip", self->tooltip, + "ejectable", self->ejectable, + "order-index", self->order_index, + "section-type", self->section_type, + "place-type", self->place_type, + "uri", self->uri, + "drive", self->drive, + "volume", self->volume, + "mount", self->mount, + NULL); +} + +GtkWidget * +gtk_sidebar_row_get_eject_button (GtkSidebarRow *self) +{ + return self->eject_button; +} + +GtkWidget * +gtk_sidebar_row_get_event_box (GtkSidebarRow *self) +{ + return self->event_box; } |