* Updated some documentation
pmo-trunk-r4218
account_store = modest_runtime_get_account_store ();
local_folders_account = MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (
modest_tny_account_store_get_local_folders_account (account_store));
account_store = modest_runtime_get_account_store ();
local_folders_account = MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (
modest_tny_account_store_get_local_folders_account (account_store));
- folder = modest_tny_local_folders_account_get_merged_outbox (local_folders_account);
+ folder = modest_tny_local_folders_account_get_merged_outbox (local_folders_account);
+ g_object_unref (local_folders_account);
} else {
folder = tny_store_account_find_folder (TNY_STORE_ACCOUNT (account), uri, NULL);
}
} else {
folder = tny_store_account_find_folder (TNY_STORE_ACCOUNT (account), uri, NULL);
}
local_folders_account = MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (
modest_tny_account_store_get_local_folders_account (account_store));
folder = modest_tny_local_folders_account_get_merged_outbox (local_folders_account);
local_folders_account = MODEST_TNY_LOCAL_FOLDERS_ACCOUNT (
modest_tny_account_store_get_local_folders_account (account_store));
folder = modest_tny_local_folders_account_get_merged_outbox (local_folders_account);
+ g_object_unref (local_folders_account);
}
if (folder) {
TnyMsg *msg = tny_folder_find_msg (folder, uri, NULL);
}
if (folder) {
TnyMsg *msg = tny_folder_find_msg (folder, uri, NULL);
is_remote = !(modest_tny_account_is_virtual_local_folders (account) ||
modest_tny_account_is_memory_card_account (account));
is_remote = !(modest_tny_account_is_virtual_local_folders (account) ||
modest_tny_account_is_memory_card_account (account));
- g_object_unref (account);
- if (!is_remote)
+ if (!is_remote) {
+ g_object_unref (account);
/* Show information banner. Remove old timeout */
if (priv->retrieving_banner_timeout > 0) {
/* Show information banner. Remove old timeout */
if (priv->retrieving_banner_timeout > 0) {
priv->retrieving_banner_timeout =
g_timeout_add (2000, show_retrieving_banner, self);
}
priv->retrieving_banner_timeout =
g_timeout_add (2000, show_retrieving_banner, self);
}
+ g_object_unref (account);
/* Get toolbar mode from operation id*/
mode = get_toolbar_mode_from_mail_operation (self, mail_op, &mode_changed);
/* Get toolbar mode from operation id*/
mode = get_toolbar_mode_from_mail_operation (self, mail_op, &mode_changed);
is_remote = !(modest_tny_account_is_virtual_local_folders (account) ||
modest_tny_account_is_memory_card_account (account));
is_remote = !(modest_tny_account_is_virtual_local_folders (account) ||
modest_tny_account_is_memory_card_account (account));
- g_object_unref (account);
- if (!is_remote)
+ if (!is_remote) {
+ g_object_unref (account);
/* Remove old timeout */
if (priv->retrieving_banner_timeout > 0) {
/* Remove old timeout */
if (priv->retrieving_banner_timeout > 0) {
priv->retrieving_banner = NULL;
}
}
priv->retrieving_banner = NULL;
}
}
+ g_object_unref (account);
/* Get toolbar mode from operation id*/
mode = get_toolbar_mode_from_mail_operation (self, mail_op, &mode_changed);
/* Get toolbar mode from operation id*/
mode = get_toolbar_mode_from_mail_operation (self, mail_op, &mode_changed);
ModestAccountRetrieveType retrieve_type;
TnyList *new_headers = NULL;
gboolean headers_only, ignore_limit;
ModestAccountRetrieveType retrieve_type;
TnyList *new_headers = NULL;
gboolean headers_only, ignore_limit;
- TnyTransportAccount *transport_account;
+ TnyTransportAccount *transport_account = NULL;
info = (UpdateAccountInfo *) user_data;
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op);
info = (UpdateAccountInfo *) user_data;
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op);
guint num_messages;
send_queue = modest_runtime_get_send_queue (transport_account);
guint num_messages;
send_queue = modest_runtime_get_send_queue (transport_account);
+ g_object_unref (transport_account);
/* Get outbox folder */
outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (send_queue));
/* Get outbox folder */
outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (send_queue));
/* Try to send */
tny_camel_send_queue_flush (TNY_CAMEL_SEND_QUEUE (send_queue));
}
/* Try to send */
tny_camel_send_queue_flush (TNY_CAMEL_SEND_QUEUE (send_queue));
}
/* Check if the operation was a success */
if (!priv->error)
/* Check if the operation was a success */
if (!priv->error)
UpdateAccountInfo *info = NULL;
ModestMailOperationPrivate *priv = NULL;
ModestTnyAccountStore *account_store = NULL;
UpdateAccountInfo *info = NULL;
ModestMailOperationPrivate *priv = NULL;
ModestTnyAccountStore *account_store = NULL;
- TnyStoreAccount *store_account = NULL;
TnyList *folders;
ModestMailOperationState *state;
TnyList *folders;
ModestMailOperationState *state;
/* Get the store account */
account_store = modest_runtime_get_account_store ();
/* Get the store account */
account_store = modest_runtime_get_account_store ();
- store_account = (TnyStoreAccount *)
modest_tny_account_store_get_server_account (account_store,
account_name,
TNY_ACCOUNT_TYPE_STORE);
modest_tny_account_store_get_server_account (account_store,
account_name,
TNY_ACCOUNT_TYPE_STORE);
- priv->account = g_object_ref (store_account);
/* Create the helper object */
info = g_slice_new0 (UpdateAccountInfo);
/* Create the helper object */
info = g_slice_new0 (UpdateAccountInfo);
/* Get all folders and continue in the callback */
folders = tny_simple_list_new ();
/* Get all folders and continue in the callback */
folders = tny_simple_list_new ();
- tny_folder_store_get_folders_async (TNY_FOLDER_STORE (store_account),
+ tny_folder_store_get_folders_async (TNY_FOLDER_STORE (priv->account),
folders, NULL,
recurse_folders_async_cb,
NULL, info);
folders, NULL,
recurse_folders_async_cb,
NULL, info);
TnyFolder *folder,
gboolean remove_to_trash)
{
TnyFolder *folder,
gboolean remove_to_trash)
{
ModestMailOperationPrivate *priv;
ModestTnyFolderRules rules;
ModestMailOperationPrivate *priv;
ModestTnyFolderRules rules;
- account = modest_tny_folder_get_account (folder);
- priv->account = g_object_ref(account);
+ priv->account = modest_tny_folder_get_account (folder);
priv->op_type = MODEST_MAIL_OPERATION_TYPE_DELETE;
/* Delete folder or move to trash */
if (remove_to_trash) {
TnyFolder *trash_folder = NULL;
priv->op_type = MODEST_MAIL_OPERATION_TYPE_DELETE;
/* Delete folder or move to trash */
if (remove_to_trash) {
TnyFolder *trash_folder = NULL;
- trash_folder = modest_tny_account_get_special_folder (account,
+ trash_folder = modest_tny_account_get_special_folder (priv->account,
TNY_FOLDER_TYPE_TRASH);
/* TODO: error_handling */
if (trash_folder) {
TNY_FOLDER_TYPE_TRASH);
/* TODO: error_handling */
if (trash_folder) {
} else
g_warning ("%s: could not get parent folder", __FUNCTION__);
}
} else
g_warning ("%s: could not get parent folder", __FUNCTION__);
}
- g_object_unref (G_OBJECT (account));
end:
/* Notify about operation end */
end:
/* Notify about operation end */
{
g_return_val_if_fail (MODEST_IS_TNY_ACCOUNT_STORE (self), NULL);
{
g_return_val_if_fail (MODEST_IS_TNY_ACCOUNT_STORE (self), NULL);
return modest_tny_account_store_get_tny_account_by (self, MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
MODEST_MMC_ACCOUNT_ID);
return modest_tny_account_store_get_tny_account_by (self, MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
MODEST_MMC_ACCOUNT_ID);
g_object_unref (account);
tny_iterator_next (acc_iter);
}
g_object_unref (account);
tny_iterator_next (acc_iter);
}
g_object_unref(acc_iter);
g_object_unref(acc_iter);
/** modest_tny_account_store_get_local_folders_account:
* @self: a TnyAccountStore instance
*
/** modest_tny_account_store_get_local_folders_account:
* @self: a TnyAccountStore instance
*
- * Get the user-visible local folders account.
+ * Get the user-visible local folders account. It returns a new
+ * reference so the caller must unref it when no longer needed
**/
TnyAccount * modest_tny_account_store_get_local_folders_account (ModestTnyAccountStore *self);
**/
TnyAccount * modest_tny_account_store_get_local_folders_account (ModestTnyAccountStore *self);
*
* Get the mmc folders account.
*
*
* Get the mmc folders account.
*
- * Returns: a #TnyAccount, or %NULL if no mmc account is available now.
+ * Returns: a #TnyAccount, or %NULL if no mmc account is available
+ * now. It returns a new reference so the caller must unref it when no
+ * longer needed
*/
TnyAccount * modest_tny_account_store_get_mmc_folders_account (ModestTnyAccountStore *self);
*/
TnyAccount * modest_tny_account_store_get_mmc_folders_account (ModestTnyAccountStore *self);
*
* Gets the transport account from a header that is in the outbox
*
*
* Gets the transport account from a header that is in the outbox
*
- * Returns: %NULL or a %TnyTransportAccount
+ * Returns: %NULL or a %TnyTransportAccount. Returns a new reference
+ * so the caller must unref it when no longer needed
-TnyTransportAccount *
-modest_tny_account_store_get_transport_account_from_outbox_header(ModestTnyAccountStore *self,
- TnyHeader *header);
+TnyTransportAccount * modest_tny_account_store_get_transport_account_from_outbox_header(ModestTnyAccountStore *self,
+ TnyHeader *header);
/**
* modest_tny_account_store_new_connection_specific_transport_account:
/**
* modest_tny_account_store_new_connection_specific_transport_account:
*
* Returns: the new #TnyTransportAccount
*/
*
* Returns: the new #TnyTransportAccount
*/
-TnyTransportAccount *
-modest_tny_account_store_new_connection_specific_transport_account (ModestTnyAccountStore *self,
- const gchar *name);
+TnyTransportAccount * modest_tny_account_store_new_connection_specific_transport_account (ModestTnyAccountStore *self,
+ const gchar *name);
if (connection_specific_account) {
tny_transport_account_send (connection_specific_account, msg, err);
if (connection_specific_account) {
tny_transport_account_send (connection_specific_account, msg, err);
+ g_object_unref (connection_specific_account);
} else {
TNY_CAMEL_TRANSPORT_ACCOUNT_CLASS(parent_class)->send (self, msg, err);
}
} else {
TNY_CAMEL_TRANSPORT_ACCOUNT_CLASS(parent_class)->send (self, msg, err);
}
new_sensitive = (proto != MODEST_PROTOCOL_STORE_POP);
}
g_object_unref (local_account);
new_sensitive = (proto != MODEST_PROTOCOL_STORE_POP);
}
g_object_unref (local_account);
+ g_object_unref (mmc_account);
}
/* Check the target folder rules */
}
/* Check the target folder rules */