diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-01 14:14:59 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-01 14:14:59 +0800 |
commit | 3950295c0f8adbf2003eb84322fa6e7c8ba6af47 (patch) | |
tree | f5095d400302809537b08cfe658ce5bf44511195 /shell/e-shortcuts.c | |
parent | d1706596df85327b41dd4b4fe39dd88f4a954dae (diff) | |
download | gsoc2013-evolution-3950295c0f8adbf2003eb84322fa6e7c8ba6af47.tar.gz gsoc2013-evolution-3950295c0f8adbf2003eb84322fa6e7c8ba6af47.tar.zst gsoc2013-evolution-3950295c0f8adbf2003eb84322fa6e7c8ba6af47.zip |
Implemented a "Rename Shortcut" command.
svn path=/trunk/; revision=10651
Diffstat (limited to 'shell/e-shortcuts.c')
-rw-r--r-- | shell/e-shortcuts.c | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c index 60453eae4b..1dff42e6f7 100644 --- a/shell/e-shortcuts.c +++ b/shell/e-shortcuts.c @@ -119,6 +119,9 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; +static void make_dirty (EShortcuts *shortcuts); + + static EShortcutItem * shortcut_item_new (const char *uri, const char *name, @@ -360,6 +363,7 @@ load_shortcuts (EShortcuts *shortcuts, /* After loading, we always have to re-save ourselves as we have merged the information we have with the information we got from the StorageSet. */ + /* FIXME: Obviously, this sucks. */ make_dirty (shortcuts); return TRUE; @@ -412,35 +416,6 @@ save_shortcuts (EShortcuts *shortcuts, return TRUE; } - -static EShortcutItem * -get_item (EShortcuts *shortcuts, - int group_num, - int num) -{ - EShortcutsPrivate *priv; - ShortcutGroup *group; - GSList *group_element; - GSList *shortcut_element; - - g_return_val_if_fail (shortcuts != NULL, NULL); - g_return_val_if_fail (E_IS_SHORTCUTS (shortcuts), NULL); - - priv = shortcuts->priv; - - group_element = g_slist_nth (priv->groups, group_num); - if (group_element == NULL) - return NULL; - - group = (ShortcutGroup *) group_element->data; - - shortcut_element = g_slist_nth (group->shortcuts, num); - if (shortcut_element == NULL) - return NULL; - - return (EShortcutItem *) shortcut_element->data; -} - /* Idle function to update the file on disk. */ @@ -533,6 +508,35 @@ update_shortcuts_by_path (EShortcuts *shortcuts, } +static EShortcutItem * +get_item (EShortcuts *shortcuts, + int group_num, + int num) +{ + EShortcutsPrivate *priv; + ShortcutGroup *group; + GSList *group_element; + GSList *shortcut_element; + + g_return_val_if_fail (shortcuts != NULL, NULL); + g_return_val_if_fail (E_IS_SHORTCUTS (shortcuts), NULL); + + priv = shortcuts->priv; + + group_element = g_slist_nth (priv->groups, group_num); + if (group_element == NULL) + return NULL; + + group = (ShortcutGroup *) group_element->data; + + shortcut_element = g_slist_nth (group->shortcuts, num); + if (shortcut_element == NULL) + return NULL; + + return (EShortcutItem *) shortcut_element->data; +} + + /* Signal handlers for the views. */ static void @@ -973,6 +977,8 @@ e_shortcuts_update_shortcut (EShortcuts *shortcuts, shortcut_item = get_item (shortcuts, group_num, num); update_shortcut_and_emit_signal (shortcuts, shortcut_item, group_num, num, uri, name, type); + + make_dirty (shortcuts); } |