[pygobject] Handle GVariants for callback arguments



commit 18a240cc492d2e5ebe2709a0d7155e27c8ff9e63
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Wed Aug 10 14:11:10 2011 +0200

    Handle GVariants for callback arguments
    
    Callbacks still use GIArgument, add missing GVariant support. This is the
    equivalent of what commit 9d5604220bd56 did for pygi_marshall_*().

 gi/pygi-argument.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 55cdfd1..96c6460 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1589,6 +1589,13 @@ _pygi_argument_to_object (GIArgument  *arg,
                         }
 
                         Py_XDECREF (py_type);
+		    } else if (type == G_TYPE_VARIANT) {
+                        PyObject *py_type;
+
+                        g_variant_ref_sink (arg->v_pointer);
+                        py_type = _pygi_type_import_by_gi_info (info);
+                        object = _pygi_struct_new ( (PyTypeObject *) py_type, arg->v_pointer,
+                                                    transfer == GI_TRANSFER_EVERYTHING);
                     } else if (type == G_TYPE_NONE) {
                         PyObject *py_type;
 



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