summaryrefslogtreecommitdiff
path: root/client/cd-util.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2011-11-24 09:18:28 +0000
committerRichard Hughes <richard@hughsie.com>2011-11-24 09:18:28 +0000
commit6b37e0785818301a5cd150fc35cd0c5c84ab5d0d (patch)
tree620c0f280baf81581718791ae41b89cd92df7d03 /client/cd-util.c
parent94112541880d3af175e8146fb560e2b1e297486d (diff)
downloadcolord-6b37e0785818301a5cd150fc35cd0c5c84ab5d0d.tar.gz
Fix colormgr device-get-default-profile
Diffstat (limited to 'client/cd-util.c')
-rw-r--r--client/cd-util.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/cd-util.c b/client/cd-util.c
index a0a51f5..ae437ce 100644
--- a/client/cd-util.c
+++ b/client/cd-util.c
@@ -1293,13 +1293,15 @@ out:
* cd_util_device_get_default_profile:
**/
static gboolean
-cd_util_device_get_default_profile (CdUtilPrivate *priv, gchar **values, GError **error)
+cd_util_device_get_default_profile (CdUtilPrivate *priv,
+ gchar **values,
+ GError **error)
{
CdDevice *device = NULL;
CdProfile *profile = NULL;
gboolean ret = TRUE;
- if (g_strv_length (values) < 2) {
+ if (g_strv_length (values) < 1) {
ret = FALSE;
g_set_error_literal (error,
1, 0,
@@ -1310,9 +1312,16 @@ cd_util_device_get_default_profile (CdUtilPrivate *priv, gchar **values, GError
}
device = cd_device_new_with_object_path (values[0]);
+ ret = cd_device_connect_sync (device, NULL, error);
+ if (!ret)
+ goto out;
profile = cd_device_get_default_profile (device);
if (profile == NULL) {
ret = FALSE;
+ g_set_error (error,
+ 1, 0,
+ "There is no assigned profile for %s",
+ values[0]);
goto out;
}
cd_util_show_profile (profile);