[gnome-builder/wip/libide-merge] drop use of private structure



commit a1c37fbb9c89546a7a5aa9ab76cdd72c1ac66e10
Author: Christian Hergert <christian hergert me>
Date:   Mon Mar 23 00:56:56 2015 -0700

    drop use of private structure

 src/tree/gb-project-tree-builder.c |   22 ++++++++--------------
 src/tree/gb-project-tree-builder.h |    8 ++------
 2 files changed, 10 insertions(+), 20 deletions(-)
---
diff --git a/src/tree/gb-project-tree-builder.c b/src/tree/gb-project-tree-builder.c
index 1f7c551..f4edceb 100644
--- a/src/tree/gb-project-tree-builder.c
+++ b/src/tree/gb-project-tree-builder.c
@@ -28,14 +28,13 @@
 # define ENABLE_ICONS
 #endif
 
-typedef struct
+struct _GbProjectTreeBuilder
 {
-  IdeContext *context;
-} GbProjectTreeBuilderPrivate;
+  GbTreeBuilder  parent_instance;
+  IdeContext    *context;
+};
 
-G_DEFINE_TYPE_WITH_PRIVATE (GbProjectTreeBuilder,
-                            gb_project_tree_builder,
-                            GB_TYPE_TREE_BUILDER)
+G_DEFINE_TYPE (GbProjectTreeBuilder, gb_project_tree_builder, GB_TYPE_TREE_BUILDER)
 
 enum {
   PROP_0,
@@ -58,23 +57,19 @@ gb_project_tree_builder_new (IdeContext *context)
 IdeContext *
 gb_project_tree_builder_get_context (GbProjectTreeBuilder *self)
 {
-  GbProjectTreeBuilderPrivate *priv = gb_project_tree_builder_get_instance_private (self);
-
   g_return_val_if_fail (GB_IS_PROJECT_TREE_BUILDER (self), NULL);
 
-  return priv->context;
+  return self->context;
 }
 
 void
 gb_project_tree_builder_set_context (GbProjectTreeBuilder *self,
                                      IdeContext           *context)
 {
-  GbProjectTreeBuilderPrivate *priv = gb_project_tree_builder_get_instance_private (self);
-
   g_return_if_fail (GB_IS_PROJECT_TREE_BUILDER (self));
   g_return_if_fail (!context || IDE_IS_CONTEXT (context));
 
-  if (g_set_object (&priv->context, context))
+  if (g_set_object (&self->context, context))
     {
       GtkWidget *tree;
 
@@ -287,9 +282,8 @@ static void
 gb_project_tree_builder_finalize (GObject *object)
 {
   GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)object;
-  GbProjectTreeBuilderPrivate *priv = gb_project_tree_builder_get_instance_private (self);
 
-  g_clear_object (&priv->context);
+  g_clear_object (&self->context);
 
   G_OBJECT_CLASS (gb_project_tree_builder_parent_class)->finalize (object);
 }
diff --git a/src/tree/gb-project-tree-builder.h b/src/tree/gb-project-tree-builder.h
index bfb7a80..66ac9d9 100644
--- a/src/tree/gb-project-tree-builder.h
+++ b/src/tree/gb-project-tree-builder.h
@@ -27,12 +27,8 @@ G_BEGIN_DECLS
 
 #define GB_TYPE_PROJECT_TREE_BUILDER (gb_project_tree_builder_get_type())
 
-G_DECLARE_DERIVABLE_TYPE (GbProjectTreeBuilder, gb_project_tree_builder, GB, PROJECT_TREE_BUILDER, 
GbTreeBuilder)
-
-struct _GbProjectTreeBuilderClass
-{
-  GbTreeBuilderClass parent;
-};
+G_DECLARE_FINAL_TYPE (GbProjectTreeBuilder, gb_project_tree_builder,
+                      GB, PROJECT_TREE_BUILDER, GbTreeBuilder)
 
 GbTreeBuilder  *gb_project_tree_builder_new         (IdeContext           *context);
 IdeContext     *gb_project_tree_builder_get_context (GbProjectTreeBuilder *self);


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