shell: Use G_DEFINE_TYPE_WITH_PRIVATE() and friends

This commit is contained in:
Florian Müllner
2015-09-24 18:56:13 +02:00
parent ffe4eaf00d
commit e25502aeb2
10 changed files with 33 additions and 58 deletions

View File

@@ -6,8 +6,6 @@
#include <telepathy-glib/telepathy-glib.h>
G_DEFINE_TYPE(ShellTpClient, shell_tp_client, TP_TYPE_BASE_CLIENT)
struct _ShellTpClientPrivate
{
ShellTpClientObserveChannelsImpl observe_impl;
@@ -23,6 +21,8 @@ struct _ShellTpClientPrivate
GDestroyNotify destroy_handle_channels;
};
G_DEFINE_TYPE_WITH_PRIVATE (ShellTpClient, shell_tp_client, TP_TYPE_BASE_CLIENT)
/**
* ShellTpClientObserveChannelsImpl:
* @client: a #ShellTpClient instance
@@ -84,8 +84,7 @@ shell_tp_client_init (ShellTpClient *self)
{
GHashTable *filter;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, SHELL_TYPE_TP_CLIENT,
ShellTpClientPrivate);
self->priv = shell_tp_client_get_instance_private (self);
/* We only care about single-user text-based chats */
filter = tp_asv_new (
@@ -198,8 +197,6 @@ shell_tp_client_class_init (ShellTpClientClass *cls)
GObjectClass *object_class = G_OBJECT_CLASS (cls);
TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls);
g_type_class_add_private (cls, sizeof (ShellTpClientPrivate));
object_class->dispose = shell_tp_client_dispose;
base_clt_cls->observe_channels = observe_channels;