aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-08 07:16:30 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-08 07:16:30 +0800
commita3075377cc82352d45107303b3cde5a22b0cfb44 (patch)
treeb92d02f3909262bbfb3a114df75b4f135ef0dd87 /shell
parent8099103dbdf39c21ba0de4c247971cd543494c80 (diff)
downloadgsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar.gz
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar.bz2
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar.lz
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar.xz
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.tar.zst
gsoc2013-evolution-a3075377cc82352d45107303b3cde5a22b0cfb44.zip
If the shortcut points to some folder in the storage set, get the type
* e-shortcuts.c (load_shortcuts): If the shortcut points to some folder in the storage set, get the type from it. * e-storage-set.c (signal_new_folder_for_all_folders_under_paths): New helper function. (signal_new_folder_for_all_folders_in_storage): New helper function. (e_storage_set_add_storage): Call the latter to emit a "new_folder" signal for all the folders contained in the newly added storage. svn path=/trunk/; revision=11750
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog13
-rw-r--r--shell/e-shortcuts.c12
-rw-r--r--shell/e-storage-set.c43
3 files changed, 65 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 49221e7fa3..bbbc7877ec 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,18 @@
2001-08-07 Ettore Perazzoli <ettore@ximian.com>
+ * e-shortcuts.c (load_shortcuts): If the shortcut points to some
+ folder in the storage set, get the type from it.
+
+ * e-storage-set.c (signal_new_folder_for_all_folders_under_paths):
+ New helper function.
+ (signal_new_folder_for_all_folders_in_storage): New helper
+ function.
+ (e_storage_set_add_storage): Call the latter to emit a
+ "new_folder" signal for all the folders contained in the newly
+ added storage.
+
+2001-08-07 Ettore Perazzoli <ettore@ximian.com>
+
[This should fix #5407, application crash on re-opening.]
* e-shell.c (e_shell_construct): Call
diff --git a/shell/e-shortcuts.c b/shell/e-shortcuts.c
index 04899064f2..a6a35d49de 100644
--- a/shell/e-shortcuts.c
+++ b/shell/e-shortcuts.c
@@ -331,8 +331,18 @@ load_shortcuts (EShortcuts *shortcuts,
name = xmlGetProp (q, "name");
type = xmlGetProp (q, "type");
- shortcut_item = shortcut_item_new (uri, name, 0, type);
+ if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0) {
+ EFolder *folder;
+
+ folder = e_storage_set_get_folder (priv->storage_set, uri + E_SHELL_URI_PREFIX_LEN);
+ if (folder != NULL) {
+ if (type != NULL)
+ xmlFree (type);
+ type = g_strdup (e_folder_get_type_string (folder));
+ }
+ }
+ shortcut_item = shortcut_item_new (uri, name, 0, type);
shortcut_group->shortcuts = g_slist_prepend (shortcut_group->shortcuts,
shortcut_item);
diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c
index e5715dde11..467ef7c98c 100644
--- a/shell/e-storage-set.c
+++ b/shell/e-storage-set.c
@@ -241,6 +241,45 @@ get_storage_for_path (EStorageSet *storage_set,
return storage;
}
+static void
+signal_new_folder_for_all_folders_under_paths (EStorageSet *storage_set,
+ EStorage *storage,
+ GList *path_list)
+{
+ GList *p;
+
+ for (p = path_list; p != NULL; p = p->next) {
+ GList *sub_path_list;
+ const char *path;
+ char *path_with_storage;
+
+ path = (const char *) p->data;
+
+ path_with_storage = g_strconcat (G_DIR_SEPARATOR_S, e_storage_get_name (storage), path, NULL);
+ gtk_signal_emit (GTK_OBJECT (storage_set), signals[NEW_FOLDER], path_with_storage);
+ g_free (path_with_storage);
+
+ sub_path_list = e_storage_get_subfolder_paths (storage, path);
+
+ signal_new_folder_for_all_folders_under_paths (storage_set, storage, sub_path_list);
+
+ e_free_string_list (sub_path_list);
+ }
+}
+
+static void
+signal_new_folder_for_all_folders_in_storage (EStorageSet *storage_set,
+ EStorage *storage)
+{
+ GList *path_list;
+
+ path_list = e_storage_get_subfolder_paths (storage, G_DIR_SEPARATOR_S);
+
+ signal_new_folder_for_all_folders_under_paths (storage_set, storage, path_list);
+
+ e_free_string_list (path_list);
+}
+
/* GtkObject methods. */
@@ -426,6 +465,8 @@ e_storage_set_add_storage (EStorageSet *storage_set,
gtk_signal_emit (GTK_OBJECT (storage_set), signals[NEW_STORAGE], storage);
+ signal_new_folder_for_all_folders_in_storage (storage_set, storage);
+
return TRUE;
}
@@ -644,8 +685,6 @@ e_storage_set_get_folder_type_registry (EStorageSet *storage_set)
}
-/* Utility functions. */
-
/**
* e_storage_set_get_path_for_physical_uri:
* @storage_set: A storage set