Use e_util_mkdir_hier() instead of e_mkdir_hier().

2006-01-10  Simon Zheng  <simon.zheng@sun.com>

        * 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
This commit is contained in:
Simon Zheng
2006-01-10 08:10:30 +00:00
committed by Harry Lu
parent e459ad918e
commit 3e82887a54
13 changed files with 62 additions and 16 deletions

View File

@ -1,3 +1,39 @@
2006-01-10 Simon Zheng <simon.zheng@sun.com>
* 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 <a9016009@gmx.de>
* evolution/mail/mail-ops.c:
* evolution/mail/mail-send-recv.c:

View File

@ -27,6 +27,7 @@
#include <string.h>
#include <gtk/gtkdialog.h>
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-util.h>
#include <libgnome/gnome-i18n.h>

View File

@ -35,6 +35,7 @@
#include <libxml/parser.h>
#include <libedataserver/e-xml-utils.h>
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-mktemp.h>
@ -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;
}

View File

@ -41,7 +41,7 @@
#endif
#include <libedataserver/e-iconv.h>
#include <libedataserver/e-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
#include <libedataserver/e-data-server-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
#include <libedataserver/e-time-utils.h>
#include "e-util/e-icon-factory.h"
#include "e-util/e-util-private.h"

View File

@ -57,6 +57,7 @@
#include <libgnome/gnome-i18n.h>
#include <e-util/e-util.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserver/e-iconv.h>
#include <e-util/e-xml-utils.h>
@ -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));

View File

@ -63,6 +63,7 @@
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-util.h>
#include "e-attachment.h"

View File

@ -68,6 +68,7 @@
#include "mail-config.h"
#include "message-tag-followup.h"
#include <libedataserver/e-data-server-util.h>
#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;

View File

@ -35,6 +35,7 @@
#include <fcntl.h>
#include <errno.h>
#include <libedataserver/e-data-server-util.h>
#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);

View File

@ -55,6 +55,7 @@
#include <bonobo/bonobo-moniker-util.h>
#include <bonobo/bonobo-exception.h>
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-util.h>
#include <misc/e-gui-utils.h>

View File

@ -46,6 +46,7 @@
#include <camel/camel-offline-store.h>
#include <camel/camel-disco-store.h>
#include <libedataserver/e-data-server-util.h>
#include "e-util/e-util.h"
#include "mail-mt.h"

View File

@ -30,7 +30,7 @@
#include <libgnome/gnome-i18n.h>
#include <libedataserver/e-msgport.h>
#include <libedataserver/e-util.h>
#include <libedataserver/e-data-server-util.h>
#include <camel/camel-url.h>
#include <camel/camel-operation.h>

View File

@ -54,6 +54,7 @@
#include "composer/e-msg-composer.h"
#include <libedataserver/e-data-server-util.h>
#include "e-util/e-util.h"
#include "e-util/e-util-private.h"

View File

@ -47,6 +47,7 @@
#include "filter/filter-option.h"
#include "filter/filter-input.h"
#include <libedataserver/e-data-server-util.h>
#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);