[gnome-builder/wip/libide: 92/153] libide: used G_DEFINE_BOXED_TYPE()



commit 05fc83af526ba80e37d6871fe6b660761bc19623
Author: Christian Hergert <christian hergert me>
Date:   Wed Feb 11 19:12:03 2015 -0800

    libide: used G_DEFINE_BOXED_TYPE()

 libide/ide-unsaved-file.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/libide/ide-unsaved-file.c b/libide/ide-unsaved-file.c
index 3ef1853..faa8eef 100644
--- a/libide/ide-unsaved-file.c
+++ b/libide/ide-unsaved-file.c
@@ -18,6 +18,9 @@
 
 #include "ide-unsaved-file.h"
 
+G_DEFINE_BOXED_TYPE (IdeUnsavedFile, ide_unsaved_file,
+                     ide_unsaved_file_ref, ide_unsaved_file_unref)
+
 struct _IdeUnsavedFile
 {
   volatile gint  ref_count;
@@ -45,25 +48,6 @@ _ide_unsaved_file_new (GFile  *file,
   return ret;
 }
 
-GType
-ide_unsaved_file_get_type (void)
-{
-  static gsize type_id;
-
-  if (g_once_init_enter (&type_id))
-    {
-      gsize _type_id;
-
-      type_id = g_boxed_type_register_static (
-          "IdeUnsavedFile",
-          (GBoxedCopyFunc)ide_unsaved_file_ref,
-          (GBoxedFreeFunc)ide_unsaved_file_unref);
-      g_once_init_leave (&type_id, _type_id);
-    }
-
-  return type_id;
-}
-
 gint64
 ide_unsaved_file_get_sequence (IdeUnsavedFile *self)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]