aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-07-11 17:29:53 +0800
committerJacob Leach <jleach@src.gnome.org>2001-07-11 17:29:53 +0800
commitfbb2f1feb0dce8cd6b14aa3450830a09e905fd1b (patch)
tree99c3e0f0151e78b368073bb999a19a0afe9b5ff0
parent73a6f3a7fa96bdfde9136d3b4a80d0f7f8150f87 (diff)
downloadgsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar.gz
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar.bz2
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar.lz
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar.xz
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.tar.zst
gsoc2013-evolution-fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b.zip
Make sure to create ~/evolution/config/ if it doesn't exist. (ShellView
2001-07-11 Jason Leach <jleach@ximian.com> * e-shell-view.c (e_shell_view_save_settings): Make sure to create ~/evolution/config/ if it doesn't exist. (ShellView settings get saved before component settings, so when the mailer comes around to saving ETree stuff, this dir will be there). Fixes bug #4279. svn path=/trunk/; revision=10991
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-shell-view.c14
2 files changed, 19 insertions, 2 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 790a58a69c..5025440c44 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-11 Jason Leach <jleach@ximian.com>
+
+ * e-shell-view.c (e_shell_view_save_settings): Make sure to create
+ ~/evolution/config/ if it doesn't exist. (ShellView settings get
+ saved before component settings, so when the mailer comes around
+ to saving ETree stuff, this dir will be there). Fixes bug #4279.
+
2001-07-10 Jason Leach <jleach@ximian.com>
* e-setup.c (copy_default_stuff): Add a temporary block of code to
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 7718f471ab..689a299871 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -28,6 +28,10 @@
#include <config.h>
#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
@@ -2158,6 +2162,7 @@ e_shell_view_save_settings (EShellView *shell_view,
char *filename;
int num_groups;
int group;
+ struct stat temp;
g_return_val_if_fail (shell_view != NULL, FALSE);
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
@@ -2220,13 +2225,18 @@ e_shell_view_save_settings (EShellView *shell_view,
g_free (prefix);
- /* Save the expanded state for this ShellViews StorageSetView */
+ /* If ~/evolution/config/ doesn't exist yet, make it */
+ filename = g_strdup_printf ("%s/config/", e_shell_get_local_directory (priv->shell));
+ if (stat (filename, &temp) != 0)
+ mkdir (filename, S_IRWXU);
+ g_free (filename);
+
+ /* Save the expanded state for this ShellView's StorageSetView */
filename = g_strdup_printf ("%s/config/storage-set-view-expanded:view_%d",
e_shell_get_local_directory (priv->shell),
view_num);
e_tree_save_expanded_state (E_TREE (priv->storage_set_view),
filename);
-
g_free (filename);
return TRUE;