X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-account.c;h=4bc365ca97536a9858568a9767e900a2464e9390;hb=a51e884b9a9a349ed272ef3c187a730d4b8c1569;hp=c5fb06fd962ef41983e37c0a19035d41f358fa4e;hpb=85e6aca5e8c16f61f95e29b62ea295d785c9cbdf;p=modest diff --git a/src/modest-tny-account.c b/src/modest-tny-account.c index c5fb06f..4bc365c 100644 --- a/src/modest-tny-account.c +++ b/src/modest-tny-account.c @@ -90,7 +90,7 @@ modest_tny_account_get_special_folder (TnyAccount *account, g_free (account_id); } else { - g_warning ("%s: modest_account_name was NULL.", __FUNCTION); + g_warning ("%s: modest_account_name was NULL.", __FUNCTION__); } } else { /* Other local folders are all in one on-disk directory: */ @@ -129,12 +129,15 @@ modest_tny_account_get_special_folder (TnyAccount *account, while (!tny_iterator_is_done (iter)) { TnyFolder *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. */ - } + if (folder) { + 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)); + } + tny_iterator_next (iter); } @@ -812,17 +815,19 @@ recurse_folders (TnyFolderStore *store, TnyFolder *folder; folder = TNY_FOLDER (tny_iterator_get_current (iter)); + if (folder) { + if (helper->task == TASK_GET_ALL_COUNT) + helper->sum += tny_folder_get_all_count (folder); - if (helper->task == TASK_GET_ALL_COUNT) - helper->sum += tny_folder_get_all_count (folder); + if (helper->task == TASK_GET_LOCAL_SIZE) + helper->sum += tny_folder_get_local_size (folder); - if (helper->task == TASK_GET_LOCAL_SIZE) - helper->sum += tny_folder_get_local_size (folder); + if (TNY_IS_FOLDER_STORE (folder)) + recurse_folders (TNY_FOLDER_STORE (folder), query, helper); - if (TNY_IS_FOLDER_STORE (folder)) - recurse_folders (TNY_FOLDER_STORE (folder), query, helper); + g_object_unref (folder); + } - g_object_unref (folder); tny_iterator_next (iter); } g_object_unref (G_OBJECT (iter));