[virt-tools-list] [PATCH 37/47] Fix filter class/object inheritance & add constructor

Daniel P. Berrange berrange at redhat.com
Wed Aug 25 19:37:32 UTC 2010


The OsinfoFilter structs mistakenly included the OsinfoEntity
structs, even though the type inherits direct from GObject.

* osinfo/osinfo_filter.c, osinfo/osinfo_filter.h: Fix
  struct parent, and add an explicit constructor
---
 osinfo/osinfo_filter.c |    6 ++++++
 osinfo/osinfo_filter.h |    6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/osinfo/osinfo_filter.c b/osinfo/osinfo_filter.c
index b60f5e3..61ac9f2 100644
--- a/osinfo/osinfo_filter.c
+++ b/osinfo/osinfo_filter.c
@@ -42,6 +42,12 @@ osinfo_filter_class_init (OsinfoFilterClass *klass)
 }
 
 
+OsinfoFilter *osinfo_filter_new(void)
+{
+    return g_object_new(OSINFO_TYPE_FILTER, NULL);
+}
+
+
 static void
 osinfo_filter_prop_constraint_free(gpointer value, gpointer opaque G_GNUC_UNUSED)
 {
diff --git a/osinfo/osinfo_filter.h b/osinfo/osinfo_filter.h
index 3f9e497..45d66b3 100644
--- a/osinfo/osinfo_filter.h
+++ b/osinfo/osinfo_filter.h
@@ -27,7 +27,7 @@ typedef struct _OsinfoFilterPrivate OsinfoFilterPrivate;
 /* object */
 struct _OsinfoFilter
 {
-    OsinfoEntity parent_instance;
+    GObject parent_instance;
 
     /* public */
 
@@ -38,13 +38,15 @@ struct _OsinfoFilter
 /* class */
 struct _OsinfoFilterClass
 {
-    OsinfoEntityClass parent_class;
+    GObjectClass parent_class;
 
     /* class members */
 };
 
 GType osinfo_filter_get_type(void);
 
+OsinfoFilter *osinfo_filter_new(void);
+
 gint osinfo_filter_add_constraint(OsinfoFilter *self, gchar *propName, gchar *propVal);
 
 // Only applicable to OSes, ignored by other types of objects
-- 
1.7.2.1




More information about the virt-tools-list mailing list