diff options
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r-- | mail/em-utils.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c index 7ebe28c11e..cee383b467 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2429,26 +2429,14 @@ emu_restore_folder_tree_state (EMFolderTree *folder_tree) g_key_file_free (key_file); } -/* checks whether uri points to a local mbox file and returns TRUE if yes. */ +/* Returns TRUE if CamelURL points to a local mbox file. */ gboolean -em_utils_is_local_delivery_mbox_file (const gchar *uri) +em_utils_is_local_delivery_mbox_file (CamelURL *url) { - g_return_val_if_fail (uri != NULL, FALSE); - - if (g_str_has_prefix (uri, "mbox:///")) { - CamelURL *curl; - - curl = camel_url_new (uri, NULL); - if (curl) { - if (curl->path - && g_file_test (curl->path, G_FILE_TEST_EXISTS) - && !g_file_test (curl->path, G_FILE_TEST_IS_DIR)) { - camel_url_free (curl); - return TRUE; - } - camel_url_free (curl); - } - } + g_return_val_if_fail (url != NULL, FALSE); - return FALSE; + return g_str_has_prefix (url->protocol, "mbox:") && + (url->path != NULL) && + g_file_test (url->path, G_FILE_TEST_EXISTS) && + !g_file_test (url->path, G_FILE_TEST_IS_DIR); } |