diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 2000-02-16 03:33:36 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 2000-02-16 03:33:36 +0800 |
commit | 9877d1b4894229ef56d94498d33dc9d983148ae5 (patch) | |
tree | 4ebe1b6b809b0695f41f438887666a0d451ec67c /e-util | |
parent | d53eea370b1a53cbae519c92fa602d0e7aa5ecc8 (diff) | |
download | gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar.gz gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar.bz2 gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar.lz gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar.xz gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.tar.zst gsoc2013-evolution-9877d1b4894229ef56d94498d33dc9d983148ae5.zip |
Add new files
svn path=/trunk/; revision=1784
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-setup.c | 51 | ||||
-rw-r--r-- | e-util/e-setup.h | 11 |
2 files changed, 62 insertions, 0 deletions
diff --git a/e-util/e-setup.c b/e-util/e-setup.c new file mode 100644 index 0000000000..20d9eee813 --- /dev/null +++ b/e-util/e-setup.c @@ -0,0 +1,51 @@ +/* + * Sets up the ~/evolution directory + * + * Author: + * Miguel de Icaza (miguel@kernel.org) + * + * (C) 2000 Helix Code, Inc. http://www.helixcode.com + */ +#include <config.h> +#include <sys/stat.h> +#include <unistd.h> +#include <gnome.h> +#include "e-setup.h" + +char *evolution_dir = NULL; +char *evolution_folders_dir = NULL; +char *evolution_private = NULL; +char *evolution_public = NULL; + +gboolean +e_setup_base_dir (void) +{ + struct stat s; + + evolution_dir = g_concat_dir_and_file (g_get_home_dir (), "evolution"); + + if (stat (evolution_dir, &s) == -1){ + if (mkdir (evolution_dir, 0600) == -1){ + return FALSE; + } + } else { + if (!S_ISDIR (s.st_mode)){ + char *msg; + + g_error ("Finish implementing this"); + + msg = g_strdup_printf ( + _("Evolution detected that the file `%s' is a not a directory.\n" + "\n" + "Evolution can rename the file, delete the file or shutdown and\n" + "let you fix the problem.")); + return FALSE; + } + } + + evolution_folders_dir = g_concat_dir_and_file (evolution_dir, "folders"); + mkdir (evolution_folders_dir, 0600); + + return TRUE; +} + diff --git a/e-util/e-setup.h b/e-util/e-setup.h new file mode 100644 index 0000000000..1c787473d9 --- /dev/null +++ b/e-util/e-setup.h @@ -0,0 +1,11 @@ +#ifndef EVOLUTION_UTIL_SETUP_H +#define EVOLUTION_UTIL_SETUP_H + +#include <glib.h> + +gboolean e_setup_base_dir (void); + +extern char *evolution_folders_dir; +extern char *evolution_dir; + +#endif /* EVOLUTION_UTIL_SETUP_H */ |