diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/uca-camera.c | 8 | ||||
-rw-r--r-- | src/uca-camera.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c index 8bb7201..27af765 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -135,8 +135,12 @@ struct _UcaCameraPrivate { static void uca_camera_set_property_unit (GParamSpec *pspec, UcaUnit unit) { - if (g_param_spec_get_qdata (pspec, UCA_UNIT_QUARK) != NULL) - g_warning ("::%s already has a unit", pspec->name); + UcaUnit old_unit; + + old_unit = (UcaUnit) GPOINTER_TO_INT (g_param_spec_get_qdata (pspec, UCA_UNIT_QUARK)); + + if (old_unit != unit && old_unit != UCA_UNIT_NA) + g_warning ("::%s already has a different unit", pspec->name); else g_param_spec_set_qdata (pspec, UCA_UNIT_QUARK, GINT_TO_POINTER (unit)); } diff --git a/src/uca-camera.h b/src/uca-camera.h index daa2bda..f4030d6 100644 --- a/src/uca-camera.h +++ b/src/uca-camera.h @@ -51,7 +51,7 @@ typedef enum { } UcaCameraTrigger; typedef enum { - UCA_UNIT_NA, + UCA_UNIT_NA = 0, UCA_UNIT_METER, UCA_UNIT_SECOND, UCA_UNIT_PIXEL, |