aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-08-08 23:53:29 +0800
committerDan Winship <danw@src.gnome.org>2000-08-08 23:53:29 +0800
commitd48034f143822558e67d587cba49e936bf64a2f8 (patch)
treeab3692b8cd193ecbbe108e5ccec50c49704dbd55
parentec85db27428484c628dc35dbfd3aecc0233bd8dc (diff)
downloadgsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.gz
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.bz2
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.lz
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.xz
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.zst
gsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.zip
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
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-setup.c32
2 files changed, 38 insertions, 1 deletions
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 <danw@helixcode.com>
+
+ * 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 <michael@helixcode.com>
* 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;
}