From d48034f143822558e67d587cba49e936bf64a2f8 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 8 Aug 2000 15:53:29 +0000 Subject: Check for ~/evolution/shortcuts.xml in addition to ~/evolution, to make * e-setup.c (e_setup): Check for ~/evolution/shortcuts.xml in addition to ~/evolution, to make sure it's really the directory we're expecting it to be. Also, convert from old-style config file to new-style config directory. svn path=/trunk/; revision=4594 --- shell/ChangeLog | 7 +++++++ shell/e-setup.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 921431b0a0..f14f761ae2 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +2000-08-08 Dan Winship + + * e-setup.c (e_setup): Check for ~/evolution/shortcuts.xml in + addition to ~/evolution, to make sure it's really the directory + we're expecting it to be. Also, convert from old-style config file + to new-style config directory. + 2000-08-04 Michael Meeks * evolution-shell-component.c (impl_ShellComponent_populate_folder_context_menu): diff --git a/shell/e-setup.c b/shell/e-setup.c index 366022493e..6ee7abcbb7 100644 --- a/shell/e-setup.c +++ b/shell/e-setup.c @@ -99,6 +99,8 @@ gboolean e_setup (const char *evolution_directory) { struct stat statinfo; + char *file; + int i; if (stat (evolution_directory, &statinfo) != 0) return copy_default_stuff (evolution_directory); @@ -106,10 +108,38 @@ e_setup (const char *evolution_directory) if (! S_ISDIR (statinfo.st_mode)) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("The file `%s' is not a directory.\n" - "Please remove it in order to allow installation\n" + "Please move it in order to allow installation\n" "of the Evolution user files.")); return FALSE; } + /* Make sure this is really our directory, not an Evolution + * build tree or something like that. + */ + file = g_strdup_printf ("%s/shortcuts.xml", evolution_directory); + if (stat (file, &statinfo) != 0) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("The directory `%s' exists but is not the\n" + "Evolution directory. Please move it in order\n" + "to allow installation of the Evolution user " + "files."), evolution_directory); + g_free (file); + return FALSE; + } + g_free (file); + + /* If the user has an old-style config file, replace it with + * the new-style config directory. FIXME: This should be + * temporary. + */ + file = g_strdup_printf ("%s/config", evolution_directory); + if (stat (file, &statinfo) == 0 && ! S_ISDIR (statinfo.st_mode)) { + char *old = g_strdup_printf ("%s.old", file); + rename (file, old); + mkdir (file, 0700); + g_free (old); + } + g_free (file); + return TRUE; } -- cgit