summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2011-02-25 15:49:10 +0000
committerRichard Hughes <richard@hughsie.com>2011-02-25 15:49:10 +0000
commit445af7d30bbb9e05347922688cc846d9de54b0a8 (patch)
treec83a0f7c90f1e68544f90a7219175c7997fce5bf
parent17467c3fc04d5596af915e1f4823969149b7650c (diff)
downloadcolord-445af7d30bbb9e05347922688cc846d9de54b0a8.tar.gz
Return the 'hard' profiles before the 'soft' profiles so that the default gets correctly set in the GUI
-rw-r--r--src/cd-device.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cd-device.c b/src/cd-device.c
index 53b96eb..7d7c7f6 100644
--- a/src/cd-device.c
+++ b/src/cd-device.c
@@ -428,14 +428,19 @@ cd_device_get_profiles_as_variant (CdDevice *device)
{
CdProfile *profile;
guint i;
+ guint idx = 0;
GVariant **profiles = NULL;
GVariant *value;
- /* copy the object paths */
+ /* copy the object paths, hard then soft */
profiles = g_new0 (GVariant *, device->priv->profiles->len + 1);
- for (i=0; i<device->priv->profiles->len; i++) {
- profile = g_ptr_array_index (device->priv->profiles, i);
- profiles[i] = g_variant_new_object_path (cd_profile_get_object_path (profile));
+ for (i=0; i<device->priv->profiles_hard->len; i++) {
+ profile = g_ptr_array_index (device->priv->profiles_hard, i);
+ profiles[idx++] = g_variant_new_object_path (cd_profile_get_object_path (profile));
+ }
+ for (i=0; i<device->priv->profiles_soft->len; i++) {
+ profile = g_ptr_array_index (device->priv->profiles_soft, i);
+ profiles[idx++] = g_variant_new_object_path (cd_profile_get_object_path (profile));
}
/* format the value */