aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-04-21 07:06:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-04-21 19:45:45 +0800
commit397aeade0545457dae034b0287049aa1cbeed782 (patch)
tree00e5f01aaea81e8add946ef0f18130841b07256f /mail/em-utils.c
parent69add830e12856ab29b96bdce7335bf18e0a2a6f (diff)
downloadgsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.gz
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.bz2
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.lz
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.xz
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.zst
gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.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);
}