[pygobject] [gi] Handle GVariants from callback return values



commit 5189b360ccddbbaee267ce857968fbf1aafdd07a
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Thu Aug 11 09:53:15 2011 +0200

    [gi] Handle GVariants from callback return values
    
    Callbacks still use GIArgument, add missing GVariant support for return types.

 gi/pygi-argument.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 96c6460..76ba6d9 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1094,8 +1094,10 @@ array_success:
                         if (transfer == GI_TRANSFER_EVERYTHING) {
                             arg.v_pointer = g_boxed_copy (type, arg.v_pointer);
                         }
-                    } else if (g_type_is_a (type, G_TYPE_POINTER) || type == G_TYPE_NONE) {
-                        g_warn_if_fail (!g_type_info_is_pointer (type_info) || transfer == GI_TRANSFER_NOTHING);
+                    } else if (g_type_is_a (type, G_TYPE_POINTER) || 
+                               g_type_is_a (type, G_TYPE_VARIANT) || 
+                               type == G_TYPE_NONE) {
+			g_warn_if_fail (g_type_is_a (type, G_TYPE_VARIANT) || !g_type_info_is_pointer (type_info) || transfer == GI_TRANSFER_NOTHING);
                         arg.v_pointer = pyg_pointer_get (object, void);
                     } else {
                         PyErr_Format (PyExc_NotImplementedError, "structure type '%s' is not supported yet", g_type_name (type));



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