2008-12-09 Claudio Saavedra <csaavedra@igalia.com>
[hildon] / src / hildon-touch-selector-entry.c
index d4ea1ed..2e20011 100644 (file)
@@ -140,7 +140,7 @@ hildon_touch_selector_entry_print_func (HildonTouchSelector * selector)
   GtkTreeModel *model;
   GtkTreeIter iter;
   gint column;
-  gchar *text;
+  gchar *text = NULL;
 
   priv = HILDON_TOUCH_SELECTOR_ENTRY_GET_PRIVATE (selector);
 
@@ -148,9 +148,10 @@ hildon_touch_selector_entry_print_func (HildonTouchSelector * selector)
     text = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry)));
   } else {
     model = hildon_touch_selector_get_model (selector, 0);
-    hildon_touch_selector_get_selected (selector, 0, &iter);
-    column = hildon_touch_selector_entry_get_text_column (HILDON_TOUCH_SELECTOR_ENTRY (selector));
-    gtk_tree_model_get (model, &iter, column, &text, -1);
+    if (hildon_touch_selector_get_selected (selector, 0, &iter)) {
+      column = hildon_touch_selector_entry_get_text_column (HILDON_TOUCH_SELECTOR_ENTRY (selector));
+      gtk_tree_model_get (model, &iter, column, &text, -1);
+    }
   }
 
   return text;
@@ -269,7 +270,9 @@ hildon_touch_selector_entry_set_text_column (HildonTouchSelectorEntry *selector,
  * hildon_touch_selector_entry_get_text_column:
  * @selector: A #HildonTouchSelectorEntry
  *
- * Returns the @column which the touch selector is using to get the strings from
+ * Gets the text column that @selector is using as a text column.
+ *
+ * Returns: the number of the column used as a text column.
  *
  **/
 gint