{
gboolean stop_trying = FALSE;
g_return_val_if_fail (data && data->account, FALSE);
-
- printf ("DEBUG: %s: tny_account_get_connection_status()==%d\n", __FUNCTION__,
- tny_account_get_connection_status (data->account));
-
+
if (data && data->account &&
/* We want to wait until TNY_CONNECTION_STATUS_INIT has changed to something else,
* after which the account is likely to be usable, or never likely to be usable soon: */
(tny_account_get_connection_status (data->account) != TNY_CONNECTION_STATUS_INIT) )
{
data->is_online = TRUE;
-
+
stop_trying = TRUE;
} else {
/* Give up if we have tried too many times: */
++(data->count_tries);
}
}
-
+
if (stop_trying) {
/* Allow the function that requested this idle callback to continue: */
if (data->loop)
g_main_loop_quit (data->loop);
-
+
if (data->account)
g_object_unref (data->account);
-
+
return FALSE; /* Don't call this again. */
} else {
return TRUE; /* Call this timeout callback again. */
model = get_model (pairs);
selector = create_touch_selector (self, model);
- gtk_tree_model_get_iter_first (GTK_TREE_MODEL(model), &iter);
- hildon_touch_selector_select_iter (HILDON_TOUCH_SELECTOR (selector), 0, &iter, TRUE);
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL(model), &iter))
+ hildon_touch_selector_select_iter (HILDON_TOUCH_SELECTOR (selector), 0, &iter, TRUE);
g_object_unref (model);
hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector));
}
/* Get the currently-active transport account for this modest account: */
- if (strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) != 0) {
+ if (account_name && strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) != 0) {
transport_account =
TNY_TRANSPORT_ACCOUNT(modest_tny_account_store_get_server_account
(modest_runtime_get_account_store (),