summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bfd933c)
* src/modest-tny-account.c:
(modest_tny_account_get_special_folder): Use an if instead of
an assert for when the parent account name is NULL, because this
might be causing a crash in projects.maemo.org bug 63192.
* src/modest-mail-operation.c:
(modest_mail_operation_send_new_mail_cb),
(modest_mail_operation_remove_folder): unref the folder that is
returned from modest_tny_account_get_special_folder().
pmo-trunk-r2770
2007-07-23 Murray Cumming <murrayc@murrayc.com>
2007-07-23 Murray Cumming <murrayc@murrayc.com>
+ * src/modest-tny-account.c:
+ (modest_tny_account_get_special_folder): Use an if instead of
+ an assert for when the parent account name is NULL, because this
+ might be causing a crash in projects.maemo.org bug 63192.
+ * src/modest-mail-operation.c:
+ (modest_mail_operation_send_new_mail_cb),
+ (modest_mail_operation_remove_folder): unref the folder that is
+ returned from modest_tny_account_get_special_folder().
+
+2007-07-23 Murray Cumming <murrayc@murrayc.com>
+
* src/modest-ui-actions.c:
(modest_ui_actions_on_password_requested):
Show mail_ib_login_cancelled info banner when the user cancels
* src/modest-ui-actions.c:
(modest_ui_actions_on_password_requested):
Show mail_ib_login_cancelled info banner when the user cancels
tny_header_set_flags (header, TNY_HEADER_FLAG_DELETED);
tny_header_set_flags (header, TNY_HEADER_FLAG_SEEN);
g_object_unref (header);
tny_header_set_flags (header, TNY_HEADER_FLAG_DELETED);
tny_header_set_flags (header, TNY_HEADER_FLAG_SEEN);
g_object_unref (header);
+ g_object_unref (folder);
trash_folder = modest_tny_account_get_special_folder (account,
TNY_FOLDER_TYPE_TRASH);
/* TODO: error_handling */
trash_folder = modest_tny_account_get_special_folder (account,
TNY_FOLDER_TYPE_TRASH);
/* TODO: error_handling */
- modest_mail_operation_xfer_folder (self, folder,
+ if (trash_folder) {
+ modest_mail_operation_xfer_folder (self, folder,
TNY_FOLDER_STORE (trash_folder),
TRUE, NULL, NULL);
TNY_FOLDER_STORE (trash_folder),
TRUE, NULL, NULL);
+ g_object_unref (trash_folder);
+ }
} else {
TnyFolderStore *parent = tny_folder_get_folder_store (folder);
} else {
TnyFolderStore *parent = tny_folder_get_folder_store (folder);
if (special_type == TNY_FOLDER_TYPE_OUTBOX) {
const gchar *modest_account_name =
modest_tny_account_get_parent_modest_account_name_for_server_account (account);
if (special_type == TNY_FOLDER_TYPE_OUTBOX) {
const gchar *modest_account_name =
modest_tny_account_get_parent_modest_account_name_for_server_account (account);
- g_assert (modest_account_name);
-
- gchar *account_id = g_strdup_printf (
- MODEST_PER_ACCOUNT_LOCAL_OUTBOX_FOLDER_ACCOUNT_ID_PREFIX "%s",
- modest_account_name);
- local_account = modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store(),
- MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
- account_id);
- if (!local_account) {
- g_printerr ("modest: %s: modest_tny_account_store_get_tny_account_by(ID) returned NULL for %s\n", __FUNCTION__, account_id);
- return NULL;
+ if (modest_account_name) {
+ gchar *account_id = g_strdup_printf (
+ MODEST_PER_ACCOUNT_LOCAL_OUTBOX_FOLDER_ACCOUNT_ID_PREFIX "%s",
+ modest_account_name);
+
+ local_account = modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store(),
+ MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
+ account_id);
+ if (!local_account) {
+ g_printerr ("modest: %s: modest_tny_account_store_get_tny_account_by(ID) returned NULL for %s\n", __FUNCTION__, account_id);
+ return NULL;
+ }
+
+ g_free (account_id);
+ } else {
+ g_warning ("%s: modest_account_name was NULL.", __FUNCTION);
} else {
/* Other local folders are all in one on-disk directory: */
local_account = modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store(),
} else {
/* Other local folders are all in one on-disk directory: */
local_account = modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store(),
TNY_FOLDER (tny_iterator_get_current (iter));
if (modest_tny_folder_get_local_folder_type (folder) == special_type) {
special_folder = folder;
TNY_FOLDER (tny_iterator_get_current (iter));
if (modest_tny_folder_get_local_folder_type (folder) == special_type) {
special_folder = folder;
+ break; /* Leaving a ref for the special_folder return value. */
}
g_object_unref (G_OBJECT(folder));
}
g_object_unref (G_OBJECT(folder));
* such as (for example) server-side Sent/Junk mail for IMAP accounts
*
* Returns: the tny folder corresponding to this special folder, or NULL in case
* such as (for example) server-side Sent/Junk mail for IMAP accounts
*
* Returns: the tny folder corresponding to this special folder, or NULL in case
- * of error, or if the special folder does not exist for this account
+ * of error, or if the special folder does not exist for this account.
+ * This must be unrefed with g_object_unref().
*/
TnyFolder* modest_tny_account_get_special_folder (TnyAccount *self,
TnyFolderType special_type);
*/
TnyFolder* modest_tny_account_get_special_folder (TnyAccount *self,
TnyFolderType special_type);