aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-setup.c
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 /shell/e-setup.c
parentec85db27428484c628dc35dbfd3aecc0233bd8dc (diff)
downloadgsoc2013-evolution-d48034f143822558e67d587cba49e936bf64a2f8.tar.gz
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
Diffstat (limited to 'shell/e-setup.c')
-rw-r--r--shell/e-setup.c32
1 files changed, 31 insertions, 1 deletions
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;
}