[libgit2-glib] Port GgitRemote to G_DECLARE_DERIVABLE_TYPE macro
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Port GgitRemote to G_DECLARE_DERIVABLE_TYPE macro
- Date: Wed, 22 Jul 2015 16:01:26 +0000 (UTC)
commit 40eff9973505d8f397af265e4e4ae3ed4f609ceb
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Jul 22 18:01:02 2015 +0200
Port GgitRemote to G_DECLARE_DERIVABLE_TYPE macro
libgit2-glib/ggit-autocleanup.h | 1 -
libgit2-glib/ggit-remote.c | 13 +++++++------
libgit2-glib/ggit-remote.h | 22 ++--------------------
libgit2-glib/ggit-repository.h | 1 +
libgit2-glib/ggit-types.h | 7 -------
5 files changed, 10 insertions(+), 34 deletions(-)
---
diff --git a/libgit2-glib/ggit-autocleanup.h b/libgit2-glib/ggit-autocleanup.h
index c6b2dcf..4efd6ad 100644
--- a/libgit2-glib/ggit-autocleanup.h
+++ b/libgit2-glib/ggit-autocleanup.h
@@ -61,7 +61,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitCred, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitCredPlaintext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitCredSshInteractive, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitCredSshKeyFromAgent, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitRemote, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitRepository, g_object_unref)
#endif /* GLIB_CHECK_VERSION (2, 44, 0) */
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index 623743c..da870bc 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -40,11 +40,13 @@ struct _GgitRemoteHead
gint ref_count;
};
-struct _GgitRemotePrivate
-{
-};
+/**
+ * GgitRemote:
+ *
+ * Represents a git remote.
+ */
-G_DEFINE_TYPE_WITH_PRIVATE (GgitRemote, ggit_remote, GGIT_TYPE_NATIVE)
+G_DEFINE_TYPE (GgitRemote, ggit_remote, GGIT_TYPE_NATIVE)
G_DEFINE_BOXED_TYPE (GgitRemoteHead, ggit_remote_head, ggit_remote_head_ref, ggit_remote_head_unref)
static GgitRemoteHead *
@@ -168,9 +170,8 @@ ggit_remote_class_init (GgitRemoteClass *klass)
}
static void
-ggit_remote_init (GgitRemote *self)
+ggit_remote_init (GgitRemote *remote)
{
- self->priv = ggit_remote_get_instance_private (self);
}
/**
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index e34f75e..53fa205 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -30,25 +30,8 @@
G_BEGIN_DECLS
-#define GGIT_TYPE_REMOTE (ggit_remote_get_type ())
-#define GGIT_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_REMOTE, GgitRemote))
-#define GGIT_REMOTE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GGIT_TYPE_REMOTE, GgitRemote
const))
-#define GGIT_REMOTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GGIT_TYPE_REMOTE, GgitRemoteClass))
-#define GGIT_IS_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GGIT_TYPE_REMOTE))
-#define GGIT_IS_REMOTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GGIT_TYPE_REMOTE))
-#define GGIT_REMOTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GGIT_TYPE_REMOTE, GgitRemoteClass))
-
-typedef struct _GgitRemoteClass GgitRemoteClass;
-typedef struct _GgitRemotePrivate GgitRemotePrivate;
-
-struct _GgitRemote
-{
- /*< private >*/
- GgitNative parent;
-
- /*< priv padding >*/
- GgitRemotePrivate *priv;
-};
+#define GGIT_TYPE_REMOTE (ggit_remote_get_type ())
+G_DECLARE_DERIVABLE_TYPE (GgitRemote, ggit_remote, GGIT, REMOTE, GgitNative)
struct _GgitRemoteClass
{
@@ -59,7 +42,6 @@ struct _GgitRemoteClass
#define GGIT_TYPE_REMOTE_HEAD (ggit_remote_head_get_type ())
#define GGIT_REMOTE_HEAD(obj) ((GgitRemoteHead *)obj)
-GType ggit_remote_get_type (void) G_GNUC_CONST;
GType ggit_remote_head_get_type (void) G_GNUC_CONST;
GgitRemoteHead *ggit_remote_head_ref (GgitRemoteHead *remote_head);
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index 79aacf4..bb813c1 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -39,6 +39,7 @@
#include <libgit2-glib/ggit-cherry-pick-options.h>
#include <libgit2-glib/ggit-commit.h>
#include <libgit2-glib/ggit-tree-builder.h>
+#include <libgit2-glib/ggit-remote.h>
G_BEGIN_DECLS
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index bcb7647..a960b5a 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -222,13 +222,6 @@ typedef struct _GgitReflog GgitReflog;
typedef struct _GgitReflogEntry GgitReflogEntry;
/**
- * GgitRemote:
- *
- * Represents a git remote.
- */
-typedef struct _GgitRemote GgitRemote;
-
-/**
* GgitRemoteHead:
*
* Represents a git remote head.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]