~ubuntu-branches/ubuntu/saucy/dee/saucy-proposed

« back to all changes in this revision

Viewing changes to src/dee-serializable.c

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2012-02-03 11:38:57 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120203113857-a46h5kyigogedqy2
Tags: 1.0.2-0ubuntu1
* New upstream release.
  - DeeModel support insert_sorted() and find_sorted() (LP: #913128)
* debian/control:
  - requires now libicu-dev
* debian/libdee-1.0-4.symbols:
  - updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
 
380
380
  g_variant_builder_add_value (&b, g_variant_new_variant (payload));
381
381
 
 
382
  g_variant_unref (payload);
 
383
 
382
384
  return g_variant_builder_end (&b);
383
385
}
384
386
 
391
393
 * You can recreate a serialized instance by calling dee_serializable_parse()
392
394
 * provided that you know the correct #GType for the serialized instance.
393
395
 *
394
 
 * Return value: A floating reference to a #GVariant with the serialized data.
395
 
 *               The variants type signature is entirely dependent of the
396
 
 *               underlying implementation.
 
396
 * Return value: (transfer full): A reference to a #GVariant with
 
397
 *               the serialized data. The variants type signature is entirely
 
398
 *               dependent of the underlying implementation. Free using
 
399
 *               g_variant_unref().
397
400
 */
398
401
GVariant*
399
402
dee_serializable_serialize (DeeSerializable *self)
400
403
{
401
404
  DeeSerializableIface *iface;
 
405
  GVariant *result;
402
406
 
403
407
  g_return_val_if_fail (DEE_IS_SERIALIZABLE (self), NULL);
404
408
 
405
409
  iface = DEE_SERIALIZABLE_GET_IFACE (self);
406
410
 
407
 
  return (* iface->serialize) (self);
 
411
  result = iface->serialize (self);
 
412
  /* Make sure we return a real reference
 
413
   * FIXME: just use g_variant_take_ref once we depend on glib 2.30 */
 
414
  if (g_variant_is_floating (result)) return g_variant_ref_sink (result);
 
415
 
 
416
  return result;
408
417
}