aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author3 <NotZed@Ximian.com>2001-10-04 05:10:12 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-04 05:10:12 +0800
commit63fe218a169ff409d8be7f85f9838c86b4cba3f1 (patch)
tree73ca580ae96536fc3d05e9978ad825e4b6020c2e
parentfd046121c7ca04a26321637bec344c470439d0f2 (diff)
downloadgsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar.gz
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar.bz2
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar.lz
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar.xz
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.tar.zst
gsoc2013-evolution-63fe218a169ff409d8be7f85f9838c86b4cba3f1.zip
Handle vtrash case, emit 'folder_created' event for the folder-cache to
2001-10-03 <NotZed@Ximian.com> * mail-local.c (local_storage_new_folder_cb): Handle vtrash case, emit 'folder_created' event for the folder-cache to work, etc. svn path=/trunk/; revision=13387
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-folder-cache.c6
-rw-r--r--mail/mail-local.c37
3 files changed, 40 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 2999bb83c5..e35d90de12 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-03 <NotZed@Ximian.com>
+
+ * mail-local.c (local_storage_new_folder_cb): Handle vtrash case,
+ emit 'folder_created' event for the folder-cache to work, etc.
+
2001-10-03 Jeffrey Stedfast <fejj@ximian.com>
* mail-format.c (mail_write_authenticity): Don't use the wax-seal
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 3212fce3ff..c99637cb09 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -205,7 +205,7 @@ folder_finalised(CamelObject *o, gpointer event_data, gpointer user_data)
{
struct _folder_info *mfi = user_data;
- d(printf("Folder finalised!\n"));
+ (printf("Folder finalised '%s'!\n", ((CamelFolder *)o)->full_name));
mfi->folder = NULL;
}
@@ -265,7 +265,7 @@ real_folder_created(CamelStore *store, void *event_data, CamelFolderInfo *fi)
{
struct _store_info *si;
- (printf("real_folder_created: %s (%s)\n", fi->full_name, fi->url));
+ d(printf("real_folder_created: %s (%s)\n", fi->full_name, fi->url));
LOCK(info_lock);
si = g_hash_table_lookup(stores, store);
@@ -293,7 +293,7 @@ store_folder_created(CamelObject *o, void *event_data, void *data)
static void
real_folder_deleted(CamelStore *store, void *event_data, CamelFolderInfo *fi)
{
- (printf("real_folder_deleted: %s (%s)\n", fi->full_name, fi->url));
+ d(printf("real_folder_deleted: %s (%s)\n", fi->full_name, fi->url));
if (strstr(fi->url, ";noselect") == NULL)
mail_vfolder_remove_uri(store, fi->url);
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 7ee5bbf841..6f1c92f2a8 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -40,6 +40,7 @@
#include "gal/widgets/e-gui-utils.h"
#include "e-util/e-path.h"
+#include "e-util/e-unicode-i18n.h"
#include "Evolution.h"
#include "evolution-storage.h"
@@ -47,6 +48,7 @@
#include "evolution-storage-listener.h"
#include "camel/camel.h"
+#include "camel/camel-vtrash-folder.h"
#include "mail.h"
#include "mail-local.h"
@@ -938,16 +940,41 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener,
const GNOME_Evolution_Folder *folder,
void *data)
{
- if (strcmp (folder->type, "mail") != 0)
- return;
-
d(printf("Local folder new:\n"));
d(printf(" path = '%s'\n uri = '%s'\n display = '%s'\n",
path, folder->physicalUri, folder->displayName));
- mail_local_store_add_folder(global_local_store, folder->physicalUri, path, folder->displayName);
+ /* We dont actually add the trash to our local folders list, get_trash is handled
+ outside our internal folder list */
+
+ if (strcmp(folder->type, "mail") == 0) {
+ mail_local_store_add_folder(global_local_store, folder->physicalUri, path, folder->displayName);
+ } else if (strcmp(folder->type, "vtrash") == 0) {
+ CamelFolderInfo info;
+ CamelURL *url;
- /* are we supposed to say anything about it? */
+ url = camel_url_new(folder->physicalUri, NULL);
+ if (url == NULL) {
+ g_warning("Shell trying to add invalid folder url: %s", folder->physicalUri);
+ return;
+ }
+ if (url->path == NULL || url->path[0] == 0) {
+ g_warning("Shell trying to add invalid folder url: %s", folder->physicalUri);
+ camel_url_free(url);
+ return;
+ }
+
+ memset(&info, 0, sizeof(info));
+ info.full_name = CAMEL_VTRASH_NAME;
+ info.name = folder->displayName;
+ info.url = g_strdup_printf("vtrash:%s", folder->physicalUri);
+ info.unread_message_count = 0;
+ info.path = (char *)path;
+
+ camel_object_trigger_event((CamelObject *)global_local_store, "folder_created", &info);
+ g_free(info.url);
+ camel_url_free(url);
+ }
}