aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shortcuts-view-model.c
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-06-06 01:10:32 +0800
committerJacob Leach <jleach@src.gnome.org>2001-06-06 01:10:32 +0800
commit8f366de2a4fb5c5bddab80667a821c1acee91c21 (patch)
tree70ca712fb4bfd275b1b94d9270cc3a7e82efa96c /shell/e-shortcuts-view-model.c
parentbd19a9d79d73216721b8409b65be9bfc9928f12c (diff)
downloadgsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.tar.gz
gsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.tar.zst
gsoc2013-evolution-8f366de2a4fb5c5bddab80667a821c1acee91c21.zip
(Fixing bug #1299: Shell saves shortcuts when display name changes)
2001-06-04 Jason Leach <jleach@ximian.com> (Fixing bug #1299: Shell saves shortcuts when display name changes) * e-shortcuts.c (class_init): New signal: "update_shortcut". * e-shortcuts-view-model.c (e_shortcuts_view_model_construct): Connect thew new signal here. * e-shortcuts-view-model.c (shortcuts_update_shortcut_cb): New function, uses the new e_shortcut_model_update_item(). * e-shell-view.c (corba_interface_set_folder_bar_label): Fix a warning here. svn path=/trunk/; revision=10116
Diffstat (limited to 'shell/e-shortcuts-view-model.c')
-rw-r--r--shell/e-shortcuts-view-model.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/shell/e-shortcuts-view-model.c b/shell/e-shortcuts-view-model.c
index 72afd70497..36625e2bfe 100644
--- a/shell/e-shortcuts-view-model.c
+++ b/shell/e-shortcuts-view-model.c
@@ -208,6 +208,38 @@ shortcuts_remove_shortcut_cb (EShortcuts *shortcuts,
e_shortcut_model_remove_item (E_SHORTCUT_MODEL (shortcuts_view_model), group_num, item_num);
}
+static void
+shortcuts_update_shortcut_cb (EShortcuts *shortcuts,
+ int group_num,
+ int item_num,
+ void *data)
+{
+ EShortcutsViewModel *shortcuts_view_model;
+ EShortcutsViewModelPrivate *priv;
+ EStorageSet *storage_set;
+ EFolder *folder;
+ const char *uri;
+ const char *storage_set_path;
+ const char *folder_name;
+
+ shortcuts_view_model = E_SHORTCUTS_VIEW_MODEL (data);
+ priv = shortcuts_view_model->priv;
+
+ uri = e_shortcuts_get_uri (priv->shortcuts, group_num, item_num);
+ g_assert (uri != NULL);
+
+ storage_set_path = get_storage_set_path_from_uri (uri);
+ if (storage_set_path == NULL)
+ return;
+
+ storage_set = e_shortcuts_get_storage_set (priv->shortcuts);
+ folder = e_storage_set_get_folder (storage_set, storage_set_path);
+ folder_name = e_folder_get_name (folder);
+
+ e_shortcut_model_update_item (E_SHORTCUT_MODEL (shortcuts_view_model),
+ group_num, item_num, uri, folder_name);
+}
+
/* GtkObject methods. */
@@ -277,6 +309,9 @@ e_shortcuts_view_model_construct (EShortcutsViewModel *model,
gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts),
"remove_shortcut", GTK_SIGNAL_FUNC (shortcuts_remove_shortcut_cb), model,
GTK_OBJECT (model));
+ gtk_signal_connect_while_alive (GTK_OBJECT (priv->shortcuts),
+ "update_shortcut", GTK_SIGNAL_FUNC (shortcuts_update_shortcut_cb), model,
+ GTK_OBJECT (model));
}
EShortcutsViewModel *