[glib-controller] iterable: Remove the iterator_type field
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-controller] iterable: Remove the iterator_type field
- Date: Wed, 7 Mar 2012 16:33:44 +0000 (UTC)
commit 165195b049245d1ef8a60d2626f6e69003166a31
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Mar 7 16:29:12 2012 +0000
iterable: Remove the iterator_type field
Iterable types need to override create_iterator(); just providing a type
is not enough, and it's usually pretty hard to do when using bindings.
glib-controller/giterable.c | 8 ++------
glib-controller/giterable.h | 2 --
2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/glib-controller/giterable.c b/glib-controller/giterable.c
index 6070df4..7a8dbce 100644
--- a/glib-controller/giterable.c
+++ b/glib-controller/giterable.c
@@ -8,11 +8,8 @@ G_DEFINE_INTERFACE (GIterable, g_iterable, G_TYPE_OBJECT)
static GIterator *
g_iterable_real_create_iterator (GIterable *iterable)
{
- GIterableInterface *iface = G_ITERABLE_GET_INTERFACE (iterable);
-
- if (iface->iterator_type != G_TYPE_INVALID &&
- g_type_is_a (iface->iterator_type, G_TYPE_ITERATOR))
- return g_iterator_create (iface->iterator_type);
+ g_warning ("The iterable of type '%s' does not implement the GIterable::create_iterator virtual function",
+ G_OBJECT_TYPE_NAME (iterable));
return NULL;
}
@@ -20,7 +17,6 @@ g_iterable_real_create_iterator (GIterable *iterable)
static void
g_iterable_default_init (GIterableInterface *iface)
{
- iface->iterator_type = G_TYPE_INVALID;
iface->create_iterator = g_iterable_real_create_iterator;
}
diff --git a/glib-controller/giterable.h b/glib-controller/giterable.h
index 6a09573..c5fe8b6 100644
--- a/glib-controller/giterable.h
+++ b/glib-controller/giterable.h
@@ -13,8 +13,6 @@ struct _GIterableInterface
{
GTypeInterface g_iface;
- GType iterator_type;
-
GIterator *(* create_iterator) (GIterable *iterable);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]