From fbb2f1feb0dce8cd6b14aa3450830a09e905fd1b Mon Sep 17 00:00:00 2001 From: Jason Leach Date: Wed, 11 Jul 2001 09:29:53 +0000 Subject: Make sure to create ~/evolution/config/ if it doesn't exist. (ShellView 2001-07-11 Jason Leach * 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 --- shell/ChangeLog | 7 +++++++ shell/e-shell-view.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'shell') 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 + + * 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 * 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 #endif +#include +#include +#include + #include #include #include @@ -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; -- cgit