~ubuntu-branches/ubuntu/saucy/telepathy-mission-control-5/saucy

« back to all changes in this revision

Viewing changes to src/mcd-account-manager.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2013-01-10 11:07:51 UTC
  • mfrom: (0.13.5)
  • Revision ID: package-import@ubuntu.com-20130110110751-fzge1h4wgrwqu1zi
Tags: 1:5.14.0-0ubuntu1
* New upstream release
* debian/control:
  - Use standards version 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
    McpAccountStorage *plugin = MCP_ACCOUNT_STORAGE (storage_plugin_obj);
327
327
    McdAccountManager *am = MCD_ACCOUNT_MANAGER (data);
328
328
    McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (am);
329
 
    McdAccountManagerClass *mclass = MCD_ACCOUNT_MANAGER_GET_CLASS (am);
330
329
    McdLoadAccountsData *lad = g_slice_new (McdLoadAccountsData);
331
330
    McdAccount *account = NULL;
332
331
    McdStorage *storage = priv->storage;
342
341
    if (mcp_account_storage_get (plugin, MCP_ACCOUNT_MANAGER (storage),
343
342
                                 name, NULL))
344
343
    {
345
 
        account = mclass->account_new (am, name);
 
344
        account = mcd_account_new (am, name);
346
345
        lad->account = account;
347
346
    }
348
347
    else
606
605
    g_free (contents);
607
606
}
608
607
 
609
 
static McdAccount *
610
 
account_new (McdAccountManager *account_manager, const gchar *name)
611
 
{
612
 
    return mcd_account_new (account_manager, name);
613
 
}
614
 
 
615
608
static void
616
609
on_account_validity_changed (McdAccount *account, gboolean valid,
617
610
                             McdAccountManager *account_manager)
924
917
                                MC_ACCOUNTS_KEY_DISPLAY_NAME, display_name,
925
918
                                FALSE);
926
919
 
927
 
    account = MCD_ACCOUNT_MANAGER_GET_CLASS (account_manager)->account_new
928
 
        (account_manager, unique_name);
 
920
    account = mcd_account_new (account_manager, unique_name);
929
921
    g_free (unique_name);
930
922
 
931
923
    if (G_LIKELY (account))
1245
1237
{
1246
1238
    MigrateCtx *ctx = user_data;
1247
1239
    gchar *display_name;
1248
 
    GValue v = {0,};
1249
 
    GValue password_v = {0,};
 
1240
    GValue v = G_VALUE_INIT;
 
1241
    GValue password_v = G_VALUE_INIT;
1250
1242
    GHashTable *parameters, *properties;
1251
1243
    gchar *str;
1252
1244
    GPtrArray *supersedes;
1440
1432
            continue;
1441
1433
        }
1442
1434
 
1443
 
        account = MCD_ACCOUNT_MANAGER_GET_CLASS (account_manager)->account_new
1444
 
            (account_manager, *name);
 
1435
        account = mcd_account_new (account_manager, *name);
1445
1436
 
1446
1437
        if (G_UNLIKELY (!account))
1447
1438
        {
1591
1582
    object_class->get_property = get_property;
1592
1583
    object_class->constructed = _mcd_account_manager_constructed;
1593
1584
 
1594
 
    klass->account_new = account_new;
1595
 
 
1596
1585
    g_object_class_install_property
1597
1586
        (object_class, PROP_DBUS_DAEMON,
1598
1587
         g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon",
1622
1611
mcd_account_manager_init (McdAccountManager *account_manager)
1623
1612
{
1624
1613
    McdAccountManagerPrivate *priv;
 
1614
 
 
1615
    priv = G_TYPE_INSTANCE_GET_PRIVATE ((account_manager),
 
1616
                                        MCD_TYPE_ACCOUNT_MANAGER,
 
1617
                                        McdAccountManagerPrivate);
 
1618
    account_manager->priv = priv;
 
1619
}
 
1620
 
 
1621
static void
 
1622
_mcd_account_manager_constructed (GObject *obj)
 
1623
{
 
1624
    McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (obj);
 
1625
    McdAccountManagerPrivate *priv = account_manager->priv;
1625
1626
    guint i = 0;
1626
1627
    static struct { const gchar *name; GCallback handler; } sig[] =
1627
1628
      { { "created", G_CALLBACK (created_cb) },
1634
1635
 
1635
1636
    DEBUG ("");
1636
1637
 
1637
 
    priv = G_TYPE_INSTANCE_GET_PRIVATE ((account_manager),
1638
 
                                        MCD_TYPE_ACCOUNT_MANAGER,
1639
 
                                        McdAccountManagerPrivate);
1640
 
    account_manager->priv = priv;
1641
 
 
1642
 
    priv->storage = mcd_storage_new ();
 
1638
    priv->storage = mcd_storage_new (priv->dbus_daemon);
1643
1639
    priv->accounts = g_hash_table_new_full (g_str_hash, g_str_equal,
1644
1640
                                            NULL, unref_account);
1645
1641
 
1662
1658
    mcd_dbus_init_interfaces_instances (account_manager);
1663
1659
}
1664
1660
 
1665
 
static void
1666
 
_mcd_account_manager_constructed (GObject *obj)
1667
 
{
1668
 
    McdAccountManager *manager = MCD_ACCOUNT_MANAGER (obj);
1669
 
    McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (manager);
1670
 
 
1671
 
    /* FIXME: I'm pretty sure we should just move most of the above code out of
1672
 
     * _init() to here and then mcd_plugin_account_manager_new() could take the
1673
 
     * TpDBusDaemon * as it should and everyone wins.
1674
 
     */
1675
 
    mcd_storage_set_dbus_daemon (priv->storage, priv->dbus_daemon);
1676
 
}
1677
 
 
1678
1661
McdAccountManager *
1679
1662
mcd_account_manager_new (TpDBusDaemon *dbus_daemon)
1680
1663
{