aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-01-24 08:56:21 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-01-24 08:56:21 +0800
commit4e98233a4d7f8e06736b716c92a04f7e0709e16e (patch)
treece2a7c44513429147e65a7b20f70e52c4e8d3de6 /shell/e-storage.c
parent15a1741ae42da39ffd66e7ba6bd0d73da99e5ac9 (diff)
downloadgsoc2013-evolution-4e98233a4d7f8e06736b716c92a04f7e0709e16e.tar.gz
gsoc2013-evolution-4e98233a4d7f8e06736b716c92a04f7e0709e16e.tar.zst
gsoc2013-evolution-4e98233a4d7f8e06736b716c92a04f7e0709e16e.zip
Fix the logic for updating the shortuct labels when the display names
of the corresponding folders change, so that it doesn't crash. I have removed the redundant "folder_updated" signal on `ELocalStorage' and changed EStorage so that it emits "updated_folder" automatically when any of the folders changes its properties. svn path=/trunk/; revision=7770
Diffstat (limited to 'shell/e-storage.c')
-rw-r--r--shell/e-storage.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/shell/e-storage.c b/shell/e-storage.c
index 9e99a61e95..72670d832d 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -84,6 +84,28 @@ folder_destroy_notify (EFolderTree *tree,
}
+/* Signal callbacks for the EFolders. */
+
+static void
+folder_changed_cb (EFolder *folder,
+ void *data)
+{
+ EStorage *storage;
+ EStoragePrivate *priv;
+ const char *path;
+
+ g_assert (E_IS_STORAGE (data));
+
+ storage = E_STORAGE (data);
+ priv = storage->priv;
+
+ path = e_folder_tree_get_path_for_data (priv->folder_tree, folder);
+ g_assert (path != NULL);
+
+ gtk_signal_emit (GTK_OBJECT (storage), signals[UPDATED_FOLDER], path);
+}
+
+
/* GtkObject methods. */
static void
@@ -502,28 +524,10 @@ e_storage_new_folder (EStorage *storage,
if (! e_folder_tree_add (priv->folder_tree, path, e_folder))
return FALSE;
- gtk_signal_emit (GTK_OBJECT (storage), signals[NEW_FOLDER], path);
-
- return TRUE;
-}
+ gtk_signal_connect_while_alive (GTK_OBJECT (e_folder), "changed", folder_changed_cb,
+ storage, GTK_OBJECT (storage));
-gboolean
-e_storage_updated_folder (EStorage *storage,
- const char *path)
-{
- EStoragePrivate *priv;
-
- g_return_val_if_fail (storage != NULL, FALSE);
- g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
- g_return_val_if_fail (path != NULL, FALSE);
- g_return_val_if_fail (g_path_is_absolute (path), FALSE);
-
- priv = storage->priv;
-
- if (e_folder_tree_get_folder (priv->folder_tree, path) == NULL)
- return FALSE;
-
- gtk_signal_emit (GTK_OBJECT (storage), signals[UPDATED_FOLDER], path);
+ gtk_signal_emit (GTK_OBJECT (storage), signals[NEW_FOLDER], path);
return TRUE;
}