From 2a1e2b524d642a9eb737fa99771b5a91e4a59609 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 14 Sep 2012 15:24:15 +0100 Subject: [PATCH 18/21] mc-tool: have a TpAutomaticClientFactory to manufacture accounts Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 --- util/mc-tool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/mc-tool.c b/util/mc-tool.c index 9cf13d5..bde8db2 100644 --- a/util/mc-tool.c +++ b/util/mc-tool.c @@ -1410,6 +1410,7 @@ main (int argc, char **argv) TpAccountManager *am = NULL; TpAccount *a = NULL; TpDBusDaemon *dbus = NULL; + TpSimpleClientFactory *client_factory = NULL; GError *error = NULL; const GQuark features[] = { TP_ACCOUNT_FEATURE_CORE, TP_ACCOUNT_FEATURE_ADDRESSING, TP_ACCOUNT_FEATURE_STORAGE, 0 }; @@ -1428,6 +1429,8 @@ main (int argc, char **argv) app_name, command.common.name, error->message); goto out; } + client_factory = TP_SIMPLE_CLIENT_FACTORY ( + tp_automatic_client_factory_new (dbus)); if (command.common.account == NULL) { TpSimpleClientFactory *factory; @@ -1442,7 +1445,8 @@ main (int argc, char **argv) else { command.common.account = ensure_prefix (command.common.account); - a = tp_account_new (dbus, command.common.account, &error); + a = tp_simple_client_factory_ensure_account (client_factory, + command.common.account, NULL, &error); if (error != NULL) { @@ -1460,6 +1464,7 @@ main (int argc, char **argv) out: g_clear_error (&error); + tp_clear_object (&client_factory); tp_clear_object (&dbus); tp_clear_object (&am); tp_clear_object (&a); -- 1.7.10.4