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

@ -45,7 +45,7 @@ struct _ShellAppSystemPrivate {
static void shell_app_system_finalize (GObject *object);
G_DEFINE_TYPE(ShellAppSystem, shell_app_system, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (ShellAppSystem, shell_app_system, G_TYPE_OBJECT);
static void shell_app_system_class_init(ShellAppSystemClass *klass)
{
@ -67,8 +67,6 @@ static void shell_app_system_class_init(ShellAppSystemClass *klass)
G_STRUCT_OFFSET (ShellAppSystemClass, installed_changed),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_type_class_add_private (gobject_class, sizeof (ShellAppSystemPrivate));
}
static void
@ -147,9 +145,7 @@ shell_app_system_init (ShellAppSystem *self)
ShellAppSystemPrivate *priv;
GAppInfoMonitor *monitor;
self->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
SHELL_TYPE_APP_SYSTEM,
ShellAppSystemPrivate);
self->priv = priv = shell_app_system_get_instance_private (self);
priv->running_apps = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL);
priv->id_to_app = g_hash_table_new_full (g_str_hash, g_str_equal,