mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gio: Use the new private instance data declaration
Use the newly added macros, and remove the explicit calls to g_type_class_add_private(). https://bugzilla.gnome.org/show_bug.cgi?id=700035
This commit is contained in:
@@ -75,8 +75,6 @@
|
||||
*/
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GSocketClient, g_socket_client, G_TYPE_OBJECT);
|
||||
|
||||
enum
|
||||
{
|
||||
EVENT,
|
||||
@@ -113,6 +111,8 @@ struct _GSocketClientPrivate
|
||||
GProxyResolver *proxy_resolver;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GSocketClient, g_socket_client, G_TYPE_OBJECT)
|
||||
|
||||
static GSocket *
|
||||
create_socket (GSocketClient *client,
|
||||
GSocketAddress *dest_address,
|
||||
@@ -199,9 +199,7 @@ clarify_connect_error (GError *error,
|
||||
static void
|
||||
g_socket_client_init (GSocketClient *client)
|
||||
{
|
||||
client->priv = G_TYPE_INSTANCE_GET_PRIVATE (client,
|
||||
G_TYPE_SOCKET_CLIENT,
|
||||
GSocketClientPrivate);
|
||||
client->priv = g_socket_client_get_private (client);
|
||||
client->priv->type = G_SOCKET_TYPE_STREAM;
|
||||
client->priv->app_proxies = g_hash_table_new_full (g_str_hash,
|
||||
g_str_equal,
|
||||
@@ -233,8 +231,7 @@ g_socket_client_finalize (GObject *object)
|
||||
g_clear_object (&client->priv->local_address);
|
||||
g_clear_object (&client->priv->proxy_resolver);
|
||||
|
||||
if (G_OBJECT_CLASS (g_socket_client_parent_class)->finalize)
|
||||
(*G_OBJECT_CLASS (g_socket_client_parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (g_socket_client_parent_class)->finalize (object);
|
||||
|
||||
g_hash_table_unref (client->priv->app_proxies);
|
||||
}
|
||||
@@ -762,8 +759,6 @@ g_socket_client_class_init (GSocketClientClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
|
||||
g_type_class_add_private (class, sizeof (GSocketClientPrivate));
|
||||
|
||||
gobject_class->finalize = g_socket_client_finalize;
|
||||
gobject_class->set_property = g_socket_client_set_property;
|
||||
gobject_class->get_property = g_socket_client_get_property;
|
||||
|
Reference in New Issue
Block a user