aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-07-03 21:29:12 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-07-03 21:29:12 +0800
commit8a9d50f560ee0d5d26c77b5868af2baa0ab0bb2f (patch)
tree86991d4bdc17ad440989fab1e5053ef3ce20660f /shell/e-shell.c
parented82a3aba83e08a76c216925e4dd99e3b22c83ab (diff)
downloadgsoc2013-evolution-8a9d50f560ee0d5d26c77b5868af2baa0ab0bb2f.tar.gz
gsoc2013-evolution-8a9d50f560ee0d5d26c77b5868af2baa0ab0bb2f.tar.zst
gsoc2013-evolution-8a9d50f560ee0d5d26c77b5868af2baa0ab0bb2f.zip
[The following makes the shell able to create the `shortcuts.xml'
file by itself when the file is not present or corrupted. Fixes #3668, failure to handle malformed shortcuts.xml file.] * e-shell.c (e_shell_construct): If the `e_shortcuts_new()' returns an object with no shortcuts in it, fill it in with `e_shortcuts_add_default_group()'. * e-shortcuts.c: New member `num_groups' in EShortcutsPrivate. (init): Init to zero. (e_shortcuts_add_group): Increment. (e_shortcuts_remove_group): Decrement. (e_shortcuts_get_num_groups): New. (e_shortcuts_add_default_group): New function to set up the default shortcuts. (e_shortcuts_new): Return an empty EShortcuts object if loading the file files, instead of returning NULL. svn path=/trunk/; revision=10744
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r--shell/e-shell.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 69ed651448..02b3cde7b2 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -826,9 +826,10 @@ e_shell_construct (EShell *shell,
priv->shortcuts = e_shortcuts_new (priv->storage_set,
priv->folder_type_registry,
shortcut_path);
+ g_assert (priv->shortcuts != NULL);
- if (priv->shortcuts == NULL)
- g_warning ("Cannot load shortcuts -- %s", shortcut_path);
+ if (e_shortcuts_get_num_groups (priv->shortcuts) == 0)
+ e_shortcuts_add_default_group (priv->shortcuts);
g_free (shortcut_path);