{
ModestMailOperationPrivate *priv;
+ g_return_val_if_fail (self, NULL);
+
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
-
+ if (!priv) {
+ g_warning ("BUG: %s: priv == NULL", __FUNCTION__);
+ return NULL;
+ }
+
return g_object_ref (priv->source);
}
MODEST_MAIL_OPERATION_STATUS_INVALID);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
+ if (!priv) {
+ g_warning ("BUG: %s: priv == NULL", __FUNCTION__);
+ return MODEST_MAIL_OPERATION_STATUS_INVALID;
+ }
+
return priv->status;
}
g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (self), NULL);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
+
+ if (!priv) {
+ g_warning ("BUG: %s: priv == NULL", __FUNCTION__);
+ return NULL;
+ }
+
return priv->error;
}
}
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
+ if (!priv) {
+ g_warning ("BUG: %s: priv == NULL", __FUNCTION__);
+ return FALSE;
+ }
- /* cancel current operation in account */
- //tny_account_cancel (priv->account);
+ /* Notify about operation end */
+ modest_mail_operation_notify_end (self);
did_a_cancel = TRUE;
/* Set new status */
priv->status = MODEST_MAIL_OPERATION_STATUS_CANCELED;
+
+ modest_mail_operation_queue_cancel_all (modest_runtime_get_mail_operation_queue());
- /* Notify about operation end */
- modest_mail_operation_notify_end (self);
-
+
return TRUE;
}
static gpointer
update_account_thread (gpointer thr_user_data)
{
+ static gboolean first_time = TRUE;
UpdateAccountInfo *info;
TnyList *all_folders = NULL;
GPtrArray *new_headers;
* for POP3, we do a logout-login upon send/receive -- many POP-servers (like Gmail) do not
* show any updates unless we do that
*/
- if (TNY_IS_CAMEL_POP_STORE_ACCOUNT(priv->account))
+ if (!first_time && TNY_IS_CAMEL_POP_STORE_ACCOUNT(priv->account))
tny_camel_pop_store_account_reconnect (TNY_CAMEL_POP_STORE_ACCOUNT(priv->account));
/* Get all the folders. We can do it synchronously because
g_free (info->retrieve_type);
g_slice_free (UpdateAccountInfo, info);
+ first_time = FALSE;
+
return NULL;
}
ModestMailOperationState *state;
ModestMailOperationPrivate *priv = NULL;
+ g_return_if_fail (self);
+
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+
+ if (!priv) {
+ g_warning ("BUG: %s: priv == NULL", __FUNCTION__);
+ return;
+ }
/* Set the account back to not busy */
- if (priv->account_name)
- {
+ if (priv->account_name) {
modest_account_mgr_set_account_busy(modest_runtime_get_account_mgr(), priv->account_name,
FALSE);
g_free(priv->account_name);