Release 2.1.92-2
[hildon] / hildon / hildon-time-selector.c
index 6f0a7b1..bf6ff13 100644 (file)
@@ -214,8 +214,7 @@ hildon_time_selector_constructor (GType type,
 
   column = hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
                                                      selector->priv->hours_model, TRUE);
-  g_object_set (column, "text-column", 0, NULL);
-
+  hildon_touch_selector_column_set_text_column (column, 0);
 
   /* we need initialization parameters in order to create minute models*/
   selector->priv->minutes_step = selector->priv->minutes_step ? selector->priv->minutes_step : 1;
@@ -224,7 +223,7 @@ hildon_time_selector_constructor (GType type,
 
   column = hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
                                                      selector->priv->minutes_model, TRUE);
-  g_object_set (column, "text-column", 0, NULL);
+  hildon_touch_selector_column_set_text_column (column, 0);
 
   if (selector->priv->ampm_format) {
     selector->priv->ampm_model = _create_ampm_model (selector);
@@ -549,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);
     }
   }
@@ -560,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));
 
@@ -623,10 +615,10 @@ hildon_time_selector_new ()
 
 /**
  * hildon_time_selector_new_step:
- *
- * Creates a new #HildonTimeSelector
- * @minutes_step: step between the minutes we are going to show in the
- * selector
+ * @minutes_step: step between the minutes in the selector.
+
+ * Creates a new #HildonTimeSelector, with @minutes_step steps between
+ * the minutes in the minutes column.
  *
  * Returns: a new #HildonTimeSelector
  *