Remove unnecessary function call redundant checks in HildonTimeSelector
authorClaudio Saavedra <csaavedra@igalia.com>
Thu, 25 Jun 2009 07:47:59 +0000 (10:47 +0300)
committerClaudio Saavedra <csaavedra@igalia.com>
Thu, 25 Jun 2009 07:47:59 +0000 (10:47 +0300)
* hildon/hildon-time-selector.c: (update_format_policy): Do
not call update_format_dependant_columns() if not necessary.
(update_format_dependant_columns): Remove unnecessary check for
the number of columns.

ChangeLog
hildon/hildon-time-selector.c

index 65131fd..9ef74ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-25  Claudio Saavedra  <csaavedra@igalia.com>
+
+       * hildon/hildon-time-selector.c: (update_format_policy): Do
+       not call update_format_dependant_columns() if not necessary.
+       (update_format_dependant_columns): Remove unnecessary check for
+       the number of columns.
+
 2009-06-24  Claudio Saavedra  <csaavedra@igalia.com>
 
        * hildon/hildon-note.c (+hildon_note_constructor),
index e64d375..bf6ff13 100644 (file)
@@ -548,7 +548,7 @@ update_format_policy                            (HildonTimeSelector *selector,
         break;
       }
 
-    if (prev_ampm_format != selector->priv->ampm_format) {
+    if (prev_ampm_format != selector->priv->ampm_format && num_columns >= 2) {
       update_format_dependant_columns (selector, hours, minutes);
     }
   }
@@ -559,13 +559,6 @@ update_format_dependant_columns                 (HildonTimeSelector *selector,
                                                  guint hours,
                                                  guint minutes)
 {
-  gint num_columns = -1;
-
-  num_columns = hildon_touch_selector_get_num_columns (HILDON_TOUCH_SELECTOR (selector));
-  if (num_columns < 2) {/* we are on the object construction */
-    return;
-  }
-
   /* To avoid an extra and wrong VALUE_CHANGED signal on the model update */
   hildon_touch_selector_block_changed (HILDON_TOUCH_SELECTOR(selector));