From 3e82887a540bab50ee5e15eb4bc7e143e5bb34f1 Mon Sep 17 00:00:00 2001 From: Simon Zheng Date: Tue, 10 Jan 2006 08:10:30 +0000 Subject: Use e_util_mkdir_hier() instead of e_mkdir_hier(). 2006-01-10 Simon Zheng * em-composer-utils.c: * em-folder-tree-model.c: (em_folder_tree_model_save_state): * em-format-html.c: * em-migrate.c: (cp_r), (em_migrate_folder), (em_migrate_pop_uid_caches_1_4), (em_migrate_folder_expand_state_1_4), (em_migrate_folder_view_settings_1_4), (em_migrate_imap_cmeta_1_4), (em_migrate_1_4), (emm_setup_initial), (em_migrate): * em-popup.c: * em-utils.c: (em_utils_save_part_to_file): * mail-component.c: (mail_component_init): * mail-config.c: * mail-folder-cache.c: * mail-mt.c: * mail-ops.c: * mail-tools.c: (mail_tool_get_local_movemail_path): Use e_util_mkdir_hier() instead of e_mkdir_hier(). Use e_util_strstrcase() instead of e_strstrcasea(). use e_strftime() in evolution-data-server/ libedataserver/e-data-server-util.c instead of the copy in evolution/e-util/e-util.c. use e_filename_make_safe() in evolution-data-server/ libedataserver/e-data-server-util.c instead of the copy in evolution/e-util/e-util.c. use e_utf8_strftime() in evolution-data-server/ libedataserver/e-data-server-util.c instead of the copy in evolution/e-util/e-util.c. svn path=/trunk/; revision=31118 --- mail/ChangeLog | 36 ++++++++++++++++++++++++++++++++++++ mail/em-composer-utils.c | 1 + mail/em-folder-tree-model.c | 3 ++- mail/em-format-html.c | 2 +- mail/em-migrate.c | 21 +++++++++++---------- mail/em-popup.c | 1 + mail/em-utils.c | 3 ++- mail/mail-component.c | 3 ++- mail/mail-config.c | 1 + mail/mail-folder-cache.c | 1 + mail/mail-mt.c | 2 +- mail/mail-ops.c | 1 + mail/mail-tools.c | 3 ++- 13 files changed, 62 insertions(+), 16 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 97728accf7..2bf44acd29 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,39 @@ +2006-01-10 Simon Zheng + + * em-composer-utils.c: + * em-folder-tree-model.c: (em_folder_tree_model_save_state): + * em-format-html.c: + * em-migrate.c: (cp_r), (em_migrate_folder), + (em_migrate_pop_uid_caches_1_4), + (em_migrate_folder_expand_state_1_4), + (em_migrate_folder_view_settings_1_4), + (em_migrate_imap_cmeta_1_4), + (em_migrate_1_4), (emm_setup_initial), + (em_migrate): + * em-popup.c: + * em-utils.c: (em_utils_save_part_to_file): + * mail-component.c: (mail_component_init): + * mail-config.c: + * mail-folder-cache.c: + * mail-mt.c: + * mail-ops.c: + * mail-tools.c: (mail_tool_get_local_movemail_path): + Use e_util_mkdir_hier() instead of e_mkdir_hier(). + + Use e_util_strstrcase() instead of e_strstrcasea(). + + use e_strftime() in evolution-data-server/ + libedataserver/e-data-server-util.c instead of the copy in + evolution/e-util/e-util.c. + + use e_filename_make_safe() in evolution-data-server/ + libedataserver/e-data-server-util.c instead of the copy in + evolution/e-util/e-util.c. + + use e_utf8_strftime() in evolution-data-server/ + libedataserver/e-data-server-util.c instead of the copy in + evolution/e-util/e-util.c. + 2006-01-06 Andre Klapper * evolution/mail/mail-ops.c: * evolution/mail/mail-send-recv.c: diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 8e3f4ca8fd..fe404a0d20 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 5b30993ce3..219ba75225 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -35,6 +35,7 @@ #include #include +#include #include @@ -1052,7 +1053,7 @@ em_folder_tree_model_save_state (EMFolderTreeModel *model) return; dirname = g_path_get_dirname (model->filename); - if (camel_mkdir (dirname, 0777) == -1 && errno != EEXIST) { + if (e_util_mkdir_hier (dirname, 0777) == -1 && errno != EEXIST) { g_free (dirname); return; } diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 52c3fe9075..7abb411e42 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -41,7 +41,7 @@ #endif #include -#include /* for e_utf8_strftime, what about e_time_format_time? */ +#include /* for e_utf8_strftime, what about e_time_format_time? */ #include #include "e-util/e-icon-factory.h" #include "e-util/e-util-private.h" diff --git a/mail/em-migrate.c b/mail/em-migrate.c index 6ac7445ea4..f5ae170683 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -57,6 +57,7 @@ #include #include +#include #include #include @@ -1521,7 +1522,7 @@ cp_r (const char *src, const char *dest, const char *pattern, int mode) struct stat st; DIR *dir; - if (camel_mkdir (dest, 0777) == -1) + if (e_util_mkdir_hier (dest, 0777) == -1) return -1; if (!(dir = opendir (src))) @@ -1642,7 +1643,7 @@ em_migrate_folder(EMMigrateSession *session, const char *dirname, const char *fu slen = src->len; dlen = dest->len; - if (camel_mkdir (dest->str, 0777) == -1 && errno != EEXIST) { + if (e_util_mkdir_hier (dest->str, 0777) == -1 && errno != EEXIST) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create new folder `%s': %s"), dest->str, g_strerror(errno)); @@ -2071,7 +2072,7 @@ em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex) g_free (cache_dir); cache_dir = g_build_filename (evolution_dir, "mail", "pop", NULL); - if (camel_mkdir (cache_dir, 0777) == -1) { + if (e_util_mkdir_hier (cache_dir, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create POP3 keep-on-server data directory `%s': %s"), cache_dir, g_strerror(errno)); @@ -2099,7 +2100,7 @@ em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex) /* strip the trailing '_' */ g_string_truncate (newpath, newpath->len - 1); - if (camel_mkdir (newpath->str, 0777) == -1 + if (e_util_mkdir_hier (newpath->str, 0777) == -1 || cp(oldpath->str, (g_string_append(newpath, "/uid-cache"))->str, FALSE, CP_UNIQUE)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to copy POP3 keep-on-server data `%s': %s"), @@ -2159,7 +2160,7 @@ em_migrate_folder_expand_state_1_4 (const char *evolution_dir, CamelException *e destpath = g_string_new (evolution_dir); g_string_append (destpath, "/mail/config"); - if (camel_mkdir (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { + if (e_util_mkdir_hier (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { g_string_free (destpath, TRUE); g_string_free (srcpath, TRUE); return 0; @@ -2257,7 +2258,7 @@ em_migrate_folder_view_settings_1_4 (const char *evolution_dir, CamelException * destpath = g_string_new (evolution_dir); g_string_append (destpath, "/mail/views"); - if (camel_mkdir (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { + if (e_util_mkdir_hier (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { g_string_free (destpath, TRUE); g_string_free (srcpath, TRUE); return 0; @@ -2473,7 +2474,7 @@ em_migrate_imap_cmeta_1_4(const char *evolution_dir, CamelException *ex) url->host?url->host:""); dir = e_path_to_physical(base, path); - if (camel_mkdir(dir, 0777) == 0) { + if (e_util_mkdir_hier(dir, 0777) == 0) { char *cmeta; FILE *fp; @@ -2571,7 +2572,7 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders path = g_strdup_printf ("mbox:%s/.evolution/mail/local", g_get_home_dir ()); if (stat (path + 5, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path + 5, 0777) == -1) { + if (errno != ENOENT || e_util_mkdir_hier (path + 5, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to create local mail storage `%s': %s"), path + 5, g_strerror (errno)); @@ -2653,7 +2654,7 @@ emm_setup_initial(const char *evolution_dir) d(printf("Setting up initial mail tree\n")); base = g_build_filename(evolution_dir, "mail/local", NULL); - if (camel_mkdir(base, 0777) == -1 && errno != EEXIST) { + if (e_util_mkdir_hier(base, 0777) == -1 && errno != EEXIST) { g_free(base); return -1; } @@ -2706,7 +2707,7 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel /* make sure ~/.evolution/mail exists */ path = g_build_filename (evolution_dir, "mail", NULL); if (g_stat (path, &st) == -1) { - if (errno != ENOENT || camel_mkdir (path, 0777) == -1) { + if (errno != ENOENT || e_util_mkdir_hier (path, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create local mail folders at `%s': %s"), path, g_strerror (errno)); diff --git a/mail/em-popup.c b/mail/em-popup.c index a31ca6866d..6aaceadc32 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -63,6 +63,7 @@ #include #include +#include #include #include "e-attachment.h" diff --git a/mail/em-utils.c b/mail/em-utils.c index 96095dcc40..059057d5a1 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -68,6 +68,7 @@ #include "mail-config.h" #include "message-tag-followup.h" +#include #include "e-util/e-util.h" #include "e-util/e-util-private.h" #include "e-util/e-mktemp.h" @@ -593,7 +594,7 @@ em_utils_save_part_to_file(GtkWidget *parent, const char *filename, CamelMimePar return FALSE; dirname = g_path_get_dirname(filename); - if (camel_mkdir(dirname, 0777) == -1) { + if (e_util_mkdir_hier(dirname, 0777) == -1) { e_error_run((GtkWindow *)parent, "mail:no-create-path", filename, g_strerror(errno), NULL); g_free(dirname); return FALSE; diff --git a/mail/mail-component.c b/mail/mail-component.c index 96285c997a..bfedb644ec 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -35,6 +35,7 @@ #include #include +#include #include "em-utils.h" #include "em-composer-utils.h" #include "em-format.h" @@ -1086,7 +1087,7 @@ mail_component_init (MailComponent *component) *p++ = '/'; } #endif - if (camel_mkdir (priv->base_directory, 0777) == -1 && errno != EEXIST) + if (e_util_mkdir_hier (priv->base_directory, 0777) == -1 && errno != EEXIST) abort (); priv->model = em_folder_tree_model_new (priv->base_directory); diff --git a/mail/mail-config.c b/mail/mail-config.c index ef695e1597..ec2b1b016d 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -55,6 +55,7 @@ #include #include +#include #include #include diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index ce41ed69fd..c0b3d361f9 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -46,6 +46,7 @@ #include #include +#include #include "e-util/e-util.h" #include "mail-mt.h" diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 18d9b1eabf..ae2ba5b590 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/mail/mail-ops.c b/mail/mail-ops.c index f8e1dce030..119c203571 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -54,6 +54,7 @@ #include "composer/e-msg-composer.h" +#include #include "e-util/e-util.h" #include "e-util/e-util-private.h" diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 0ae2445fb8..cedf4a01c7 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -47,6 +47,7 @@ #include "filter/filter-option.h" #include "filter/filter-input.h" +#include #include "em-utils.h" #include "em-vfolder-context.h" #include "em-vfolder-rule.h" @@ -115,7 +116,7 @@ mail_tool_get_local_movemail_path (const unsigned char *uri, CamelException *ex) *c = '_'; path = g_strdup_printf("%s/mail/spool", mail_component_peek_base_directory(NULL)); - if (g_stat(path, &st) == -1 && camel_mkdir(path, 0777) == -1) { + if (g_stat(path, &st) == -1 && e_util_mkdir_hier(path, 0777) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Could not create spool directory `%s': %s"), path, g_strerror(errno)); g_free(path); -- cgit