aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-19 08:47:58 +0800
committerDan Winship <danw@src.gnome.org>2000-05-19 08:47:58 +0800
commit99f97dea4462119c6b03901969a476663b7dcf06 (patch)
tree7c739c02e4bd3d40010acb13486a525356a88c03
parent2e6a57075d4757b0e29011303f3a29ef0d00b4ba (diff)
downloadgsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar.gz
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar.bz2
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar.lz
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar.xz
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.tar.zst
gsoc2013-evolution-99f97dea4462119c6b03901969a476663b7dcf06.zip
Update for camel_folder_get_uids (folder_changed,
* message-list.c (select_msg): Update for camel_folder_get_uids (folder_changed, message_list_set_folder): Update for camel_folder_get_summary * mail-ops.c (fetch_mail): Update for camel_folder_get_uids svn path=/trunk/; revision=3128
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-ops.c17
-rw-r--r--mail/message-list.c43
3 files changed, 37 insertions, 31 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5f943eb045..b3b68a764f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-05-18 Dan Winship <danw@helixcode.com>
+
+ * message-list.c (select_msg): Update for camel_folder_get_uids
+ (folder_changed, message_list_set_folder): Update for
+ camel_folder_get_summary
+
+ * mail-ops.c (fetch_mail): Update for camel_folder_get_uids
+
2000-05-17 Dan Winship <danw@helixcode.com>
* mail-component.c: This seems to be cruft. Nuke it.
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index dc338a1805..90acb9e84d 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -170,9 +170,9 @@ fetch_mail (GtkWidget *button, gpointer user_data)
/* can we perform filtering on this source? */
if (!(sourcefolder->has_summary_capability
- && sourcefolder->has_uid_capability
&& sourcefolder->has_search_capability)) {
- int i, count;
+ GPtrArray *uids;
+ int i;
printf("folder isn't searchable, performing movemail ...\n");
@@ -191,12 +191,12 @@ fetch_mail (GtkWidget *button, gpointer user_data)
goto cleanup;
}
- count = camel_folder_get_message_count (sourcefolder, ex);
- printf("got %d messages in source\n", count);
- for (i = 1; i <= count; i++) {
+ uids = camel_folder_get_uids (sourcefolder, ex);
+ printf("got %d messages in source\n", uids->len);
+ for (i = 0; i < uids->len; i++) {
CamelMimeMessage *msg;
- printf("copying message %d to dest\n", i);
- msg = camel_folder_get_message_by_number (sourcefolder, i, ex);
+ printf("copying message %d to dest\n", i + 1);
+ msg = camel_folder_get_message_by_uid (sourcefolder, uids->pdata[i], ex);
if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) {
mail_exception_dialog ("Unable to read message", ex, fb);
gtk_object_unref((GtkObject *)msg);
@@ -212,9 +212,10 @@ fetch_mail (GtkWidget *button, gpointer user_data)
goto cleanup;
}
- camel_folder_delete_message_by_number(sourcefolder, i, ex);
+ camel_folder_delete_message_by_uid(sourcefolder, uids->pdata[i], ex);
gtk_object_unref((GtkObject *)msg);
}
+ camel_folder_free_uids (sourcefolder, uids);
gtk_object_unref((GtkObject *)sourcefolder);
} else {
printf("we can search on this folder, performing search!\n");
diff --git a/mail/message-list.c b/mail/message-list.c
index 8c28e51957..2fe47c87ca 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -90,32 +90,29 @@ select_msg (MessageList *message_list, gint row)
{
CamelException ex;
CamelMimeMessage *message = NULL;
+ CamelMessageInfo *msg_info;
camel_exception_init (&ex);
- if (camel_folder_has_uid_capability (message_list->folder)) {
- CamelMessageInfo *msg_info;
-
- msg_info = get_message_info(message_list, row);
- if (msg_info) {
- message = camel_folder_get_message_by_uid (message_list->folder,
- msg_info->uid,
- &ex);
- if (camel_exception_get_id (&ex)) {
- printf ("Unable to get message: %s\n",
- ex.desc?ex.desc:"unknown_reason");
- return;
- }
- }
-
- if (message) {
- gtk_signal_connect((GtkObject *)message, "message_changed", message_changed, message_list);
- mail_display_set_message (message_list->parent_folder_browser->mail_display,
- CAMEL_MEDIUM (message));
- gtk_object_unref (GTK_OBJECT (message));
+ msg_info = get_message_info(message_list, row);
+ if (msg_info) {
+ message = camel_folder_get_message_by_uid (message_list->folder,
+ msg_info->uid,
+ &ex);
+ if (camel_exception_get_id (&ex)) {
+ printf ("Unable to get message: %s\n",
+ ex.desc?ex.desc:"unknown_reason");
+ return;
}
}
-
+
+ if (message) {
+ gtk_signal_connect((GtkObject *)message, "message_changed",
+ message_changed, message_list);
+ mail_display_set_message (message_list->parent_folder_browser->mail_display,
+ CAMEL_MEDIUM (message));
+ gtk_object_unref (GTK_OBJECT (message));
+ }
}
/*
@@ -712,7 +709,7 @@ folder_changed(CamelFolder *f, int type, MessageList *message_list)
{
if (message_list->summary_table)
g_ptr_array_free(message_list->summary_table, TRUE);
- message_list->summary_table = camel_folder_summary_get_message_info (message_list->folder, 0, INT_MAX);
+ message_list->summary_table = camel_folder_get_summary (message_list->folder, NULL);
message_list_set_search(message_list, message_list->search);
}
@@ -780,7 +777,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder)
gtk_object_ref (GTK_OBJECT (camel_folder));
- message_list->summary_table = camel_folder_summary_get_message_info (message_list->folder, 0, INT_MAX);
+ message_list->summary_table = camel_folder_get_summary (message_list->folder, NULL);
e_table_model_changed (message_list->table_model);
select_msg (message_list, 0);