aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-04-21 07:06:35 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:55 +0800
commit0be9b1f878c2f54a0c7f2f5024125813022d81b1 (patch)
tree29e3c02eb85eb6c0059d7160821f09930bbf9b44 /mail/em-utils.c
parent7b71f8f18c283032a9edf2f2a191e2c693cb2a61 (diff)
downloadgsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.gz
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.bz2
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.lz
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.xz
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.zst
gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.zip
Adapt to CamelService changes.
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c26
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);
}