* Fixes NB#103682, correctly select the default region
[modest] / src / hildon2 / modest-provider-picker.c
index aef688c..fb6a1cd 100644 (file)
@@ -35,6 +35,7 @@
 #include <modest-text-utils.h>
 #include "modest-protocol-registry.h"
 #include "modest-runtime.h"
+#include <modest-account-protocol.h>
 
 #include <stdlib.h>
 #include <string.h> /* For memcpy() */
@@ -111,7 +112,7 @@ provider_sort_func (GtkTreeModel *model, GtkTreeIter *iter1, GtkTreeIter *iter2,
 }
 
 static gchar *
-touch_selector_print_func (HildonTouchSelector *selector)
+touch_selector_print_func (HildonTouchSelector *selector, gpointer userdata)
 {
        GtkTreeIter iter;
        if (hildon_touch_selector_get_selected (HILDON_TOUCH_SELECTOR (selector), 0, &iter)) {
@@ -170,7 +171,7 @@ modest_provider_picker_new (HildonSizeType size,
                                             renderer, "text", MODEL_COL_NAME, NULL);
 
        hildon_touch_selector_set_model (HILDON_TOUCH_SELECTOR (selector), 0, GTK_TREE_MODEL (priv->model));
-       hildon_touch_selector_set_print_func (HILDON_TOUCH_SELECTOR (selector), touch_selector_print_func);
+       hildon_touch_selector_set_print_func (HILDON_TOUCH_SELECTOR (selector), (HildonTouchSelectorPrintFunc) touch_selector_print_func);
 
        hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector));
        modest_provider_picker_set_others_provider (MODEST_PROVIDER_PICKER (self));
@@ -262,6 +263,11 @@ modest_provider_picker_fill (ModestProviderPicker *self,
                                continue;
                }
 
+               if (MODEST_ACCOUNT_PROTOCOL (proto) && 
+                   !modest_account_protocol_is_supported (MODEST_ACCOUNT_PROTOCOL (proto))) {
+                       continue;
+               }
+
                gtk_list_store_append (liststore, &iter);
                gtk_list_store_set (liststore, &iter,
                                    MODEL_COL_ID, modest_protocol_get_name (proto),