~ubuntu-branches/ubuntu/saucy/gnome-online-accounts/saucy

« back to all changes in this revision

Viewing changes to src/goa/goaclient.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-08-20 22:37:44 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120820223744-ndi1s9124mef09ak
Tags: 3.5.90-0ubuntu1
* New upstream release.
* debian/control.in:
  - Build-depend on krb5-config, libgcr-3-dev, and libkrb5-dev
* debian/rules:
  - Enable Kerberos provider
* debian/libgoa-1.0-0.symbols: Added new symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2
2
/*
3
 
 * Copyright (C) 2011 Red Hat, Inc.
 
3
 * Copyright (C) 2011, 2012 Red Hat, Inc.
4
4
 *
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Lesser General Public
481
481
  return ret;
482
482
}
483
483
 
 
484
/**
 
485
 * goa_client_lookup_by_id:
 
486
 * @client: A #GoaClient.
 
487
 * @id: The ID to look for.
 
488
 *
 
489
 * Finds and returns the #GoaObject instance whose
 
490
 * <link
 
491
 * linkend="gdbus-property-org-gnome-OnlineAccounts-Account.Id">"Id"</link>
 
492
 * D-Bus property matches @id.
 
493
 *
 
494
 * Returns: (transfer full): A #GoaObject. Free the returned
 
495
 * object with g_object_unref().
 
496
 */
 
497
GoaObject *
 
498
goa_client_lookup_by_id (GoaClient           *client,
 
499
                         const gchar         *id)
 
500
{
 
501
  GList *accounts;
 
502
  GList *l;
 
503
  GoaObject *ret;
 
504
 
 
505
  ret = NULL;
 
506
 
 
507
  accounts = goa_client_get_accounts (client);
 
508
  for (l = accounts; l != NULL; l = g_list_next (l))
 
509
    {
 
510
      GoaAccount *account;
 
511
      GoaObject *object = GOA_OBJECT (l->data);
 
512
 
 
513
      account = goa_object_peek_account (object);
 
514
      if (account == NULL)
 
515
        continue;
 
516
 
 
517
      if (g_strcmp0 (goa_account_get_id (account), id) == 0)
 
518
        {
 
519
          ret = g_object_ref (object);
 
520
          break;
 
521
        }
 
522
    }
 
523
 
 
524
  g_list_free_full (accounts, g_object_unref);
 
525
  return ret;
 
526
}
 
527
 
484
528
/* ---------------------------------------------------------------------------------------------------- */
485
529
 
486
530
static void