aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-26 12:25:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-26 12:25:10 +0800
commitac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456 (patch)
treed31bbdc1752aea650b3bfadb272492291d3f8228 /mail/mail-folder-cache.c
parent1c11041eebd485a471e842ba4f75834c2ce6e1f7 (diff)
downloadgsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar.gz
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar.bz2
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar.lz
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar.xz
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.tar.zst
gsoc2013-evolution-ac8e0571f2e3478a2f1fc2a55a2df7dbf8aa0456.zip
set the default selection to inbox.
2004-05-26 Not Zed <NotZed@Ximian.com> * importers/evolution-mbox-importer.c (create_control_fn): set the default selection to inbox. * importers/evolution-outlook-importer.c (folder_selected) (create_control_fn): copied from mbox importer. fixes a crash & lets you choose the target folder. 2004-05-25 Not Zed <NotZed@Ximian.com> * mail-component.c (mc_add_local_store_done): removed, now redundant. * em-folder-tree.c (em_folder_tree_set_selected): fix for path changes. * em-folder-tree-model.c (em_folder_tree_model_set_unread_count): change to use full name rather than path name. * em-folder-tree-model.h: renamed path_hash to full_hash. * em-folder-tree-model.c (folder_subscribed): dont use g_path_get_dirname here, it is os dependent, we want / always. (full_hash_free): rename from path_hash free. svn path=/trunk/; revision=26090
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 4f2e3b20d2..43071e45f9 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -66,7 +66,6 @@ static pthread_mutex_t info_lock = PTHREAD_MUTEX_INITIALIZER;
struct _folder_info {
struct _store_info *store_info; /* 'parent' link */
- char *path; /* shell path */
char *full_name; /* full name of folder/folderinfo */
char *uri; /* uri of folder */
@@ -86,9 +85,9 @@ struct _folder_update {
unsigned int unsub:1; /* unsubcribing? */
unsigned int new:1; /* new mail arrived? */
- char *path;
+ char *full_name;
char *uri;
- char *oldpath;
+ char *oldfull;
char *olduri;
int unread;
@@ -134,11 +133,11 @@ static int count_trash = FALSE;
static void
free_update(struct _folder_update *up)
{
- g_free(up->path);
+ g_free(up->full_name);
g_free(up->uri);
if (up->store)
camel_object_unref(up->store);
- g_free(up->oldpath);
+ g_free(up->oldfull);
g_free(up->olduri);
g_free(up);
}
@@ -221,7 +220,7 @@ real_flush_updates(void *o, void *event_data, void *data)
}
/* update unread counts */
- em_folder_tree_model_set_unread_count (model, up->store, up->path, up->unread);
+ em_folder_tree_model_set_unread_count (model, up->store, up->full_name, up->unread);
/* new mail notification */
if (notify_type == -1) {
@@ -277,7 +276,7 @@ unset_folder_info(struct _folder_info *mfi, int delete, int unsub)
up->delete = delete;
up->unsub = unsub;
up->store = mfi->store_info->store;
- up->path = g_strdup (mfi->path);
+ up->full_name = g_strdup (mfi->full_name);
camel_object_ref(up->store);
up->uri = g_strdup(mfi->uri);
@@ -289,7 +288,6 @@ unset_folder_info(struct _folder_info *mfi, int delete, int unsub)
static void
free_folder_info(struct _folder_info *mfi)
{
- g_free(mfi->path);
g_free(mfi->full_name);
g_free(mfi->uri);
g_free(mfi);
@@ -356,7 +354,7 @@ update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info)
return;
up = g_malloc0(sizeof(*up));
- up->path = g_strdup(mfi->path);
+ up->full_name = g_strdup(mfi->full_name);
up->unread = unread;
up->new = new ? 1 : 0;
up->store = mfi->store_info->store;
@@ -377,7 +375,6 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
} else {
/*d(printf("Adding new folder: %s (%s) %d unread\n", fi->path, fi->url, fi->unread_message_count));*/
mfi = g_malloc0(sizeof(*mfi));
- mfi->path = g_strdup(fi->path);
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->uri);
mfi->store_info = si;
@@ -387,7 +384,7 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
g_hash_table_insert(si->folders_uri, mfi->uri, mfi);
up = g_malloc0(sizeof(*up));
- up->path = g_strdup(mfi->path);
+ up->full_name = g_strdup(mfi->full_name);
up->uri = g_strdup(fi->uri);
up->unread = (fi->unread==-1)?0:fi->unread;
up->store = si->store;
@@ -581,14 +578,12 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
if (mfi) {
d(printf("Found old folder '%s' renaming to '%s'\n", mfi->full_name, fi->full_name));
- up->oldpath = mfi->path;
+ up->oldfull = mfi->full_name;
up->olduri = mfi->uri;
/* Its a rename op */
g_hash_table_remove(si->folders, mfi->full_name);
g_hash_table_remove(si->folders, mfi->uri);
- g_free(mfi->full_name);
- mfi->path = g_strdup(fi->path);
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->uri);
mfi->flags = fi->flags;
@@ -599,7 +594,6 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
d(printf("Rename found a new folder? old '%s' new '%s'\n", old, fi->full_name));
/* Its a new op */
mfi = g_malloc0(sizeof(*mfi));
- mfi->path = g_strdup(fi->path);
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->uri);
mfi->store_info = si;
@@ -611,7 +605,7 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
g_free(old);
- up->path = g_strdup(mfi->path);
+ up->full_name = g_strdup(mfi->full_name);
up->uri = g_strdup(mfi->uri);
up->unread = fi->unread==-1?0:fi->unread;
up->store = si->store;
@@ -649,7 +643,7 @@ folder_cmp(const void *ap, const void *bp)
const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0];
- return strcmp(a->path, b->path);
+ return strcmp(a->full_name, b->full_name);
}
static void