datetime: Fix elm_datetime_field_limit_set.
authorwoochan lee <wc0917.lee@samsung.com>
Mon, 23 Feb 2015 08:48:37 +0000 (17:48 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Mon, 23 Feb 2015 08:58:19 +0000 (17:58 +0900)
Summary:
If user sets the limit value using elm_datetime_field_limit_set() API, the filed value will be recalculated.
Even though the value changed in case, value changed signal didn't send to user before.
@fix

Reviewers: seoz, woohyun, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D1980

src/lib/elm_datetime.c

index e9fa349..6948e45 100644 (file)
@@ -984,11 +984,13 @@ EOLIAN static void
 _elm_datetime_field_limit_set(Eo *obj, Elm_Datetime_Data *sd, Elm_Datetime_Field_Type fieldtype, int min, int max)
 {
    Datetime_Field *field;
+   struct tm old_time;
 
    if (fieldtype >= ELM_DATETIME_AMPM) return;
 
    if (min > max) return;
 
+   old_time = sd->curr_time;
    field = sd->field_list + fieldtype;
    if (((min >= mapping[fieldtype].def_min) &&
         (min <= mapping[fieldtype].def_max)) ||
@@ -1000,6 +1002,9 @@ _elm_datetime_field_limit_set(Eo *obj, Elm_Datetime_Data *sd, Elm_Datetime_Field
      field->max = max;
 
    _apply_field_limits(obj);
+
+   if (!_date_cmp(&old_time, &sd->curr_time))
+     evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
 }
 
 EOLIAN static Eina_Bool