[libgd] main-icon-view: Use G_ADD_PRIVATE
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] main-icon-view: Use G_ADD_PRIVATE
- Date: Sat, 26 Nov 2016 10:11:29 +0000 (UTC)
commit 504fb2ad08b155a8a775df786948c122d2b46c80
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Nov 23 15:11:51 2016 +0100
main-icon-view: Use G_ADD_PRIVATE
This paves the way for improving our GObject use and reducing the
amount of boilerplate.
G_ADD_PRIVATE was introduced in GLib 2.38, which should be old enough
for all users.
https://bugzilla.gnome.org/show_bug.cgi?id=774709
libgd/gd-main-icon-view.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libgd/gd-main-icon-view.c b/libgd/gd-main-icon-view.c
index 5b230ed..744f05d 100644
--- a/libgd/gd-main-icon-view.c
+++ b/libgd/gd-main-icon-view.c
@@ -41,6 +41,7 @@ struct _GdMainIconViewPrivate {
static void gd_main_view_generic_iface_init (GdMainViewGenericIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdMainIconView, gd_main_icon_view, GTK_TYPE_ICON_VIEW,
+ G_ADD_PRIVATE (GdMainIconView)
G_IMPLEMENT_INTERFACE (GD_TYPE_MAIN_VIEW_GENERIC,
gd_main_view_generic_iface_init))
@@ -339,9 +340,6 @@ gd_main_icon_view_class_init (GdMainIconViewClass *klass)
-1, G_MAXINT, 40,
G_PARAM_READWRITE));
- g_type_class_add_private (klass, sizeof (GdMainIconViewPrivate));
-
-
for (i = 0; i < G_N_ELEMENTS (activate_modifiers); i++)
{
gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, activate_modifiers[i],
@@ -360,7 +358,7 @@ gd_main_icon_view_class_init (GdMainIconViewClass *klass)
static void
gd_main_icon_view_init (GdMainIconView *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GD_TYPE_MAIN_ICON_VIEW, GdMainIconViewPrivate);
+ self->priv = gd_main_icon_view_get_instance_private (self);
g_signal_connect (self, "notify::model",
G_CALLBACK (set_attributes_from_model), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]