aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-09-21 03:34:58 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-21 03:34:58 +0800
commit55690284e1557f5c85bc8edae36b3cf3817eff9e (patch)
treeffdddd8c001cfc66fd9a8d75ca535b67b13af538 /mail/mail-folder-cache.c
parent66ec2f9d1ef656f558173d69cc5f917743fb3dfb (diff)
downloadgsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar.gz
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar.bz2
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar.lz
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar.xz
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.tar.zst
gsoc2013-evolution-55690284e1557f5c85bc8edae36b3cf3817eff9e.zip
Dont special case file: url's anymore.
2001-09-20 <NotZed@Ximian.com> * mail-tools.c (mail_tool_uri_to_folder): Dont special case file: url's anymore. * mail-local.c: Add real_path to MailLocalFolder. (mail_local_folder_construct): Added path argument, setup full_name == path, and real_path == full_name. (mls_get_folder): First lookup folderinfo to confirm this folder exists, then use that to properly construct the folder paths. (mail_local_folder_reconfigure): Use real_path not full_name to create the store uri. (mlf_set_folder): Use real_path not folder_name to get real uri path. 2001-09-19 <NotZed@Ximian.com> * mail-folder-cache.c (setup_store): Use the wrong spelling of finalised for the event hook. (real_note_folder): Use the wrong spelling of finalised for the event hook. (free_folder_info): Free the full_name parameter. (setup_folder): (real_note_folder): Key the folderinfo table on full_name, not path. svn path=/trunk/; revision=13014
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 9514724271..32c68b75de 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -40,7 +40,7 @@
#include "mail-folder-cache.h"
#include "mail-ops.h"
-#define d(x)
+#define d(x) x
/* note that many things are effectively serialised by having them run in
the main loop thread which they need to do because of corba/gtk calls */
@@ -52,13 +52,14 @@ static pthread_mutex_t info_lock = PTHREAD_MUTEX_INITIALIZER;
struct _folder_info {
struct _store_info *store_info; /* 'parent' link */
- char *path;
+ char *path; /* shell path */
char *name; /* shell display name? */
+ char *full_name; /* full name of folder/folderinfo */
CamelFolder *folder; /* if known */
};
struct _store_info {
- GHashTable *folders; /* by path */
+ GHashTable *folders; /* by full_name */
/* only 1 should be set */
EvolutionStorage *storage;
@@ -106,7 +107,7 @@ setup_folder(const char *path, CamelFolderInfo *fi, struct _store_info *si)
int unread = fi->unread_message_count;
LOCK(info_lock);
- mfi = g_hash_table_lookup(si->folders, path);
+ mfi = g_hash_table_lookup(si->folders, fi->full_name);
if (mfi) {
UNLOCK(info_lock);
update_1folder(mfi, fi);
@@ -116,8 +117,9 @@ setup_folder(const char *path, CamelFolderInfo *fi, struct _store_info *si)
mfi = g_malloc0(sizeof(*mfi));
mfi->path = g_strdup(path);
mfi->name = g_strdup(fi->name);
+ mfi->full_name = g_strdup(fi->full_name);
mfi->store_info = si;
- g_hash_table_insert(si->folders, mfi->path, mfi);
+ g_hash_table_insert(si->folders, mfi->full_name, mfi);
UNLOCK(info_lock);
if (si->storage != NULL) {
@@ -178,7 +180,7 @@ real_note_folder(CamelFolder *folder, char *path, void *data)
path = g_strdup_printf("/%s", folder->full_name);
LOCK(info_lock);
- mfi = g_hash_table_lookup(si->folders, path);
+ mfi = g_hash_table_lookup(si->folders, folder->full_name);
UNLOCK(info_lock);
if (mfi == NULL) {
@@ -198,7 +200,7 @@ real_note_folder(CamelFolder *folder, char *path, void *data)
camel_object_hook_event((CamelObject *)folder, "folder_changed", folder_changed, mfi);
camel_object_hook_event((CamelObject *)folder, "message_changed", folder_changed, mfi);
- camel_object_hook_event((CamelObject *)folder, "finalised", folder_finalised, mfi);
+ camel_object_hook_event((CamelObject *)folder, "finalized", folder_finalised, mfi);
camel_object_unref((CamelObject *)folder);
}
@@ -271,6 +273,7 @@ free_folder_info(char *path, struct _folder_info *info, void *data)
{
g_free(info->path);
g_free(info->name);
+ g_free(info->full_name);
}
static void
@@ -343,7 +346,7 @@ setup_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storag
camel_object_hook_event((CamelObject *)store, "folder_created", store_folder_created, NULL);
camel_object_hook_event((CamelObject *)store, "folder_deleted", store_folder_deleted, NULL);
- camel_object_hook_event((CamelObject *)store, "finalised", store_finalised, NULL);
+ camel_object_hook_event((CamelObject *)store, "finalized", store_finalised, NULL);
}
UNLOCK(info_lock);