* Fixes several memory leaks
[modest] / src / hildon2 / modest-secureauth-picker.c
index 7b15cdb..14b52f8 100644 (file)
@@ -79,7 +79,7 @@ enum MODEL_COLS {
        MODEL_COL_ID = 1 /* an int. */
 };
 
-void modest_secureauth_picker_fill (ModestSecureauthPicker *picker);
+static void modest_secureauth_picker_fill (ModestSecureauthPicker *picker);
 
 static gchar *
 touch_selector_print_func (HildonTouchSelector *selector)
@@ -145,7 +145,8 @@ modest_secureauth_picker_new (HildonSizeType size,
  * #picker: The combo box.
  * @protocol: IMAP or POP.
  */
-void modest_secureauth_picker_fill (ModestSecureauthPicker *picker)
+static void 
+modest_secureauth_picker_fill (ModestSecureauthPicker *picker)
 {      
        ModestSecureauthPickerPrivate *priv;
        GtkListStore *liststore;
@@ -171,6 +172,14 @@ void modest_secureauth_picker_fill (ModestSecureauthPicker *picker)
                                    MODEL_COL_ID, (gint)modest_protocol_get_type_id (protocol),
                                    MODEL_COL_NAME, modest_protocol_get_display_name (protocol),
                                    -1);
+               if (modest_protocol_get_type_id (protocol) == MODEST_PROTOCOLS_AUTH_NONE) {
+                       HildonTouchSelector *selector;
+                       selector = hildon_picker_button_get_selector (HILDON_PICKER_BUTTON (picker));
+                       hildon_touch_selector_select_iter (HILDON_TOUCH_SELECTOR (selector), 0, &iter, TRUE);
+                       hildon_button_set_value (HILDON_BUTTON (picker), 
+                                                hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector)));
+                       
+               }
        }       
 }