aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-table-adapter.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-table-adapter.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 12be6c821d..5bd188ccec 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -171,13 +171,11 @@ addressbook_set_value_at (ETableModel *etc,
EAddressbookTableAdapterPrivate *priv = adapter->priv;
if (e_addressbook_model_get_editable (priv->model)) {
+ EClientCache *client_cache;
ESourceRegistry *registry;
EBookClient *book_client;
EContact *contact;
- registry = e_addressbook_model_get_registry (priv->model);
- book_client = e_addressbook_model_get_client (priv->model);
-
if (col >= COLS || row >= e_addressbook_model_contact_count (priv->model))
return;
@@ -197,11 +195,19 @@ addressbook_set_value_at (ETableModel *etc,
g_hash_table_remove (priv->emails, old_value);
}
+ client_cache =
+ e_addressbook_model_get_client_cache (priv->model);
+ book_client = e_addressbook_model_get_client (priv->model);
+
+ registry = e_client_cache_ref_registry (client_cache);
+
e_contact_set (contact, col, (gpointer) val);
eab_merging_book_modify_contact (
registry, book_client,
contact, contact_modified_cb, etc);
+ g_object_unref (registry);
+
g_object_unref (contact);
/* XXX Do we need this? Shouldn't the commit_contact
@@ -226,6 +232,7 @@ addressbook_append_row (ETableModel *etm,
{
EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER (etm);
EAddressbookTableAdapterPrivate *priv = adapter->priv;
+ EClientCache *client_cache;
ESourceRegistry *registry;
EBookClient *book_client;
EContact *contact;
@@ -238,12 +245,17 @@ addressbook_append_row (ETableModel *etm,
e_contact_set (contact, col, (gpointer) val);
}
- registry = e_addressbook_model_get_registry (priv->model);
+ client_cache =
+ e_addressbook_model_get_client_cache (priv->model);
book_client = e_addressbook_model_get_client (priv->model);
+ registry = e_client_cache_ref_registry (client_cache);
+
eab_merging_book_add_contact (
registry, book_client, contact, NULL, NULL);
+ g_object_unref (registry);
+
g_object_unref (contact);
}