summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-01 13:44:45 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-01 14:08:07 +0100
commit82071042392f05c66e04345ed160a61cf6cea82c (patch)
treea6c97de218ca79a7c4e9ebcf9d694859a32b5588
parentf369b2e82eec2da877d34195d9154db9d2a93787 (diff)
downloadtelepathy-mission-control-82071042392f05c66e04345ed160a61cf6cea82c.tar.gz
mc-tool: use the global singleton client factory
-rw-r--r--util/mc-tool.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/util/mc-tool.c b/util/mc-tool.c
index f642fe97..9fa3faea 100644
--- a/util/mc-tool.c
+++ b/util/mc-tool.c
@@ -1471,7 +1471,6 @@ main (int argc, char **argv)
{
TpAccountManager *am = NULL;
TpAccount *a = NULL;
- TpDBusDaemon *dbus = NULL;
TpClientFactory *client_factory = NULL;
GError *error = NULL;
const GQuark features[] = { TP_ACCOUNT_FEATURE_CORE,
@@ -1485,7 +1484,8 @@ main (int argc, char **argv)
command.common.ret = 1;
- dbus = tp_dbus_daemon_dup (&error);
+ client_factory = tp_client_factory_dup (&error);
+
if (error != NULL)
{
fprintf (stderr, "%s %s: Failed to connect to D-Bus: %s\n",
@@ -1493,17 +1493,10 @@ main (int argc, char **argv)
goto out;
}
- client_factory = tp_client_factory_new (dbus);
-
if (command.common.account == NULL)
{
- TpClientFactory *factory;
-
- am = tp_account_manager_new (dbus);
- factory = tp_proxy_get_factory (am);
-
- tp_client_factory_add_account_features (factory, features);
-
+ tp_client_factory_add_account_features (client_factory, features);
+ am = tp_client_factory_ensure_account_manager (client_factory);
tp_proxy_prepare_async (am, NULL, manager_ready, NULL);
}
else
@@ -1528,7 +1521,6 @@ 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);
tp_clear_pointer (&main_loop, g_main_loop_unref);