diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-12-13 08:45:09 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-12-13 08:45:09 +0800 |
commit | 8a2afc351781ab3af6b151f276fcdf87b8519f25 (patch) | |
tree | 0754ed26a243f03182e247890311e36b1b398a91 /shell | |
parent | 3681ee807965177dbd13619cbf42571adcef6341 (diff) | |
download | gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar.gz gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar.bz2 gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar.lz gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar.xz gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.tar.zst gsoc2013-evolution-8a2afc351781ab3af6b151f276fcdf87b8519f25.zip |
New helper function to create the `~/evolution/private' directory.
* e-setup.c (setup_bonobo_conf_private_directory): New helper
function to create the `~/evolution/private' directory.
(e_setup): Call it.
svn path=/trunk/; revision=15012
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-setup.c | 49 |
2 files changed, 58 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index fbbcf9b569..2c98894337 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2001-12-12 Ettore Perazzoli <ettore@ximian.com> + + [Fix #14838, saving passwords doesn't work. It is actually a + workaround for some obscure Bonobo-conf bug.] + + * e-setup.c (setup_bonobo_conf_private_directory): New helper + function to create the `~/evolution/private' directory. + (e_setup): Call it. + 2001-12-05 Ettore Perazzoli <ettore@ximian.com> * e-shell-about-box.c: Add missing comma. diff --git a/shell/e-setup.c b/shell/e-setup.c index fb5930bef6..31c16eca2b 100644 --- a/shell/e-setup.c +++ b/shell/e-setup.c @@ -266,6 +266,52 @@ e_shell_rm_dir (const char *path) } +/* FIXME: This is a workaround for bonobo-conf breakage. */ +static gboolean +setup_bonobo_conf_private_directory (const char *evolution_directory) +{ + char *name; + struct stat buf; + + name = g_concat_dir_and_file (evolution_directory, "private"); + if (stat (name, &buf) == -1) { + if (mkdir (name, 0700) != 0) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("Evolution could not create directory\n" + "%s:\n%s"), + name, strerror (errno)); + free (name); + return FALSE; + } + + free (name); + return TRUE; + } + + if (S_ISDIR (buf.st_mode) && access (name, R_OK | W_OK | X_OK) == 0) { + free (name); + return TRUE; + } + + if (S_ISDIR (buf.st_mode)) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("Directory %s\n" + "does not have the right permissions. Please make it\n" + "readable and executable and restart Evolution."), + name); + } else { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("File %s\n" + "should be removed to allow Evolution to work correctly.\n" + "Please remove this file and restart Evolution."), + name, strerror (errno)); + } + + free (name); + return FALSE; +} + + gboolean e_setup (const char *evolution_directory) { @@ -360,6 +406,9 @@ e_setup (const char *evolution_directory) } g_free (file); + if (! setup_bonobo_conf_private_directory (evolution_directory)) + return FALSE; + /* User has evolution directory... Check if it is up to date. */ return check_evolution_directory (evolution_directory); |