aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-07 02:01:30 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-07 02:01:30 +0800
commit02bcba4fad4a8a9254b1179f3442d056098cf9a3 (patch)
tree79b32cbe6b4d0535e33fd3115074bdced2eb8d2b
parent885a1f44666b6f6e51c9b6bc4b170410befbd41d (diff)
downloadgsoc2013-evolution-02bcba4fad4a8a9254b1179f3442d056098cf9a3.tar.gz
gsoc2013-evolution-02bcba4fad4a8a9254b1179f3442d056098cf9a3.tar.zst
gsoc2013-evolution-02bcba4fad4a8a9254b1179f3442d056098cf9a3.zip
Bug #638810 - Crash in camel_folder_search_set_folder with IMAP account
-rw-r--r--mail/mail-vfolder.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 7afcb6c11b..f5039d98ff 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -239,16 +239,17 @@ vfolder_adduri_exec (struct _adduri_msg *m,
/* we dont try lookup the cache if we are removing it, its no longer there */
if (!m->remove &&
- !mail_folder_cache_get_folder_from_uri (folder_cache, m->uri, &folder)) {
+ !mail_folder_cache_get_folder_from_uri (folder_cache, m->uri, NULL)) {
g_warning (
"Folder '%s' disappeared while I was "
"adding/removing it to/from my vfolder", m->uri);
return;
}
- if (folder == NULL)
- folder = e_mail_session_uri_to_folder_sync (
- m->session, m->uri, 0, cancellable, error);
+ /* always pick fresh folders - they are
+ from CamelStore's folders bag anyway */
+ folder = e_mail_session_uri_to_folder_sync (
+ m->session, m->uri, 0, cancellable, error);
if (folder != NULL) {
l = m->folders;
@@ -678,7 +679,6 @@ rule_add_sources (EMailSession *session,
GList *sources_folder = *sources_folderp;
GList *sources_uri = *sources_urip;
MailFolderCache *folder_cache;
- CamelFolder *newfolder;
GList *head, *link;
folder_cache = e_mail_session_get_folder_cache (session);
@@ -687,14 +687,10 @@ rule_add_sources (EMailSession *session,
for (link = head; link != NULL; link = g_list_next (link)) {
const gchar *uri = link->data;
- if (mail_folder_cache_get_folder_from_uri (
- folder_cache, uri, &newfolder)) {
- if (newfolder)
- sources_folder = g_list_append (
- sources_folder, newfolder);
- else
- sources_uri = g_list_append (
- sources_uri, g_strdup (uri));
+ /* always pick fresh folders - they are
+ from CamelStore's folders bag anyway */
+ if (mail_folder_cache_get_folder_from_uri (folder_cache, uri, NULL)) {
+ sources_uri = g_list_append (sources_uri, g_strdup (uri));
}
}