~ubuntu-branches/ubuntu/oneiric/libtelepathy/oneiric

« back to all changes in this revision

Viewing changes to src/tp-props-iface.c

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons
  • Date: 2007-03-12 11:43:26 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070312114326-v4aezxb6sr8utds1
Tags: 0.0.51-2
Bump shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "tp-ifaces-signals-marshal.h"
25
25
#include "tp-props-iface-gen.h"
26
26
#include "tp-props-iface.h"
 
27
#include "internal.h"
27
28
 
28
29
 
29
30
#define TP_TYPE_PROPERTY_DESCRIPTION (dbus_g_type_get_struct ("GValueArray", \
75
76
{
76
77
  gboolean properties_ready;
77
78
 
78
 
  int mappings_len;
 
79
  guint mappings_len;
79
80
  PropertyMapping *mappings;
80
81
};
81
82
 
128
129
static void tp_props_iface_finalize(GObject *obj)
129
130
{
130
131
  TpPropsIface *self = TELEPATHY_PROPS_IFACE(obj);
131
 
  int i;
 
132
  guint i;
132
133
  for (i=0; i < PRIV(self)->mappings_len; i++)
133
134
    {
134
135
      if (PRIV(self)->mappings[i].value)
334
335
gboolean tp_props_iface_get_value (TpPropsIface* self, guint prop_id,
335
336
                                  GValue *return_value)
336
337
{
337
 
  int i;
 
338
  guint i;
338
339
 
339
340
  if (!PRIV (self)->properties_ready)
340
341
    return FALSE;
381
382
                                  const GValue *value)
382
383
{
383
384
  /*TODO add option for an error callback*/
384
 
  int i;
 
385
  guint i;
385
386
  GPtrArray *props;
386
387
 
387
388
  if (!PRIV(self)->properties_ready)
413
414
  return FALSE;
414
415
}
415
416
 
 
417
TelepathyPropertyFlags
 
418
tp_props_iface_property_flags (TpPropsIface *self,
 
419
                               guint prop_id)
 
420
{
 
421
  guint i;
 
422
 
 
423
  if (!PRIV (self)->properties_ready)
 
424
    return 0;
 
425
 
 
426
  for (i = 0; i < PRIV (self)->mappings_len; i++)
 
427
    {
 
428
      if (PRIV (self)->mappings[i].user_id == prop_id)
 
429
        {
 
430
          return PRIV (self)->mappings[i].flags;
 
431
        }
 
432
    }
 
433
 
 
434
  return 0;
 
435
}
416
436
 
417
437
static void
418
438
set_properties_values (TpPropsIface *self, GPtrArray *properties)
419
439
{
420
 
  int i,j;
 
440
  guint i, j;
421
441
 
422
442
  for (i = 0; i < properties->len; i++)
423
443
    {
475
495
 
476
496
  if (error)
477
497
    {
478
 
      g_debug ("getting properties failed: %s (%s)", error->message,
479
 
        dbus_g_error_get_name (error));
 
498
      _tp_warn_failure ("getting properties", error);
480
499
      g_error_free (error);
481
500
      return;
482
501
    }
496
515
{
497
516
  TpPropsIface *self = TELEPATHY_PROPS_IFACE (user_data);
498
517
  GArray *get_props;
499
 
  int i, j;
 
518
  guint i, j;
500
519
 
501
520
  if (!PRIV(self)->properties_ready)
502
521
    return;
543
562
properties_listed_cb (DBusGProxy *proxy, GPtrArray *properties, GError *error, gpointer user_data)
544
563
{
545
564
  TpPropsIface *self = TELEPATHY_PROPS_IFACE (user_data);
546
 
  int i,j;
 
565
  guint i, j;
547
566
  guint32 id, flags;
548
567
  gchar *name;
549
568
  GArray *get_props;
550
569
 
551
570
  if (error)
552
571
    {
553
 
      g_debug ("listing properties failed: %s (%s)", error->message,
554
 
        dbus_g_error_get_name (error));
 
572
      _tp_warn_failure ("listing properties", error);
555
573
      g_error_free (error);
556
574
      return;
557
575
    }