diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-08-13 14:16:17 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-08-13 14:16:17 +0200 |
commit | 972bc48715450e61ae79c705b95ddabcc2b1bbc9 (patch) | |
tree | 4e26ee2930777744ef5a647f68a2b5aa117ff488 /src/uca-camera.c | |
parent | 04767fda6abe4bc71bbf061122ad723cc8addcc1 (diff) | |
download | libuca-972bc48715450e61ae79c705b95ddabcc2b1bbc9.tar.gz libuca-972bc48715450e61ae79c705b95ddabcc2b1bbc9.tar.bz2 libuca-972bc48715450e61ae79c705b95ddabcc2b1bbc9.tar.xz libuca-972bc48715450e61ae79c705b95ddabcc2b1bbc9.zip |
Fix re-setting a unit on the same camera class
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r-- | src/uca-camera.c | 8 |
1 files changed, 6 insertions, 2 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)); } |