summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2012-11-21 21:38:01 +0000
committerRichard Hughes <richard@hughsie.com>2012-11-21 21:38:04 +0000
commit49cc45deb53b879c904fd2ce059277db9c87a9f8 (patch)
tree2c3c35ae622a3bf6d53b9e215c53510538c95cac /client
parentf02b4e8f07ae098a3596acf7782deb82c681390e (diff)
downloadcolord-49cc45deb53b879c904fd2ce059277db9c87a9f8.tar.gz
Do not try to connect to colord in cd-fix-profile until actually needed
This speeds up the startup of the tool and also means it can be used on build servers without colord or DBus running.
Diffstat (limited to 'client')
-rw-r--r--client/cd-fix-profile.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/client/cd-fix-profile.c b/client/cd-fix-profile.c
index d968e8b..3a481cf 100644
--- a/client/cd-fix-profile.c
+++ b/client/cd-fix-profile.c
@@ -384,11 +384,14 @@ cd_util_get_standard_space_filename (CdUtilPrivate *priv,
CdStandardSpace standard_space,
GError **error)
{
- CdProfile *profile_tmp;
+ CdProfile *profile_tmp = NULL;
gboolean ret;
gchar *filename = NULL;
/* try to find */
+ ret = cd_client_connect_sync (priv->client, NULL, error);
+ if (!ret)
+ goto out;
profile_tmp = cd_client_get_standard_space_sync (priv->client,
standard_space,
NULL,
@@ -1101,12 +1104,6 @@ main (int argc, char *argv[])
/* create helper object */
priv = g_new0 (CdUtilPrivate, 1);
priv->client = cd_client_new ();
- ret = cd_client_connect_sync (priv->client, NULL, &error);
- if (!ret) {
- g_print ("%s\n", error->message);
- g_error_free (error);
- goto out;
- }
/* add commands */
priv->cmd_array = g_ptr_array_new_with_free_func ((GDestroyNotify) cd_util_item_free);