Skip to content

Commit

Permalink
webhelper: Use modern GObject private data
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Apr 25, 2024
1 parent d19aee6 commit 52ab3eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/webhelper.m4
Expand Up @@ -4,7 +4,7 @@ AC_DEFUN([GP_CHECK_WEBHELPER],
GTK_VERSION=2.16
dnl 2.22 for glib-mkenums' @basename@ template
GLIB_VERSION=2.22
GLIB_VERSION=2.38
GIO_VERSION=2.18
GDK_PIXBUF_VERSION=2.0
WEBKIT_VERSION=1.1.18
Expand Down
7 changes: 2 additions & 5 deletions webhelper/src/gwh-browser.c
Expand Up @@ -78,7 +78,7 @@ static const gdouble zoom_in_factor = 1.2;
static const gdouble zoom_out_factor = 1.0 / 1.2;


G_DEFINE_TYPE (GwhBrowser, gwh_browser, GTK_TYPE_VBOX)
G_DEFINE_TYPE_WITH_PRIVATE (GwhBrowser, gwh_browser, GTK_TYPE_VBOX)


static void
Expand Down Expand Up @@ -685,8 +685,6 @@ gwh_browser_class_init (GwhBrowserClass *klass)
"The browser's toolbar",
GTK_TYPE_TOOLBAR,
G_PARAM_READABLE));

g_type_class_add_private (klass, sizeof (GwhBrowserPrivate));
}

/* a GtkEntryCompletionMatchFunc matching anywhere in the haystack */
Expand Down Expand Up @@ -893,8 +891,7 @@ gwh_browser_init (GwhBrowser *self)
WebKitWebContext *wkcontext;
gboolean inspector_detached;

self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GWH_TYPE_BROWSER,
GwhBrowserPrivate);
self->priv = gwh_browser_get_instance_private (self);

self->priv->default_icon = NULL;
/* web view need to be created first because we use it in create_toolbar() */
Expand Down
7 changes: 2 additions & 5 deletions webhelper/src/gwh-settings.c
Expand Up @@ -35,7 +35,7 @@ struct _GwhSettingsPrivate
};


G_DEFINE_TYPE (GwhSettings, gwh_settings, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GwhSettings, gwh_settings, G_TYPE_OBJECT)


static void
Expand Down Expand Up @@ -124,15 +124,12 @@ gwh_settings_class_init (GwhSettingsClass *klass)
object_class->finalize = gwh_settings_finalize;
object_class->get_property = gwh_settings_get_property;
object_class->set_property = gwh_settings_set_property;

g_type_class_add_private (klass, sizeof (GwhSettingsPrivate));
}

static void
gwh_settings_init (GwhSettings *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GWH_TYPE_SETTINGS,
GwhSettingsPrivate);
self->priv = gwh_settings_get_instance_private (self);
self->priv->prop_array = g_ptr_array_new ();
}

Expand Down

0 comments on commit 52ab3eb

Please sign in to comment.