Changeset 3235
- Timestamp:
- 01/11/08 13:45:47
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-stream-buffer.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (6 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store-summary.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (6 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-engine.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c (modified) (6 diffs)
- trunk/libtinymail-camel/camel-lite/summary/summary.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-bs-mime-part.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-bs-msg-receive-strategy.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-imap-folder.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-mime-part.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-msg-header.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-queue.c (modified) (1 diff)
- trunk/libtinymail/tny-folder-monitor.c (modified) (1 diff)
- trunk/libtinymail/tny-header.c (modified) (1 diff)
- trunk/libtinymail/tny-mime-part.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (modified) (5 diffs)
- trunk/libtinymailui-gtk/tny-gtk-msg-view.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3232 r3235 3 3 * Preparations for the new summary store 4 4 * Made all remaining static libraries LTLIBRARIES 5 * Fixed compiler warnings 5 6 6 7 2008-01-11 Alberto Garcia Gonzalez <agarcia@igalia.com> trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.c
r3217 r3235 862 862 * Returns %0 on success or %-1 on fail 863 863 **/ 864 865 #ifdef SAVE_APPEND 864 866 static int 865 867 camel_folder_summary_save_append (CamelFolderSummary *s, CamelException *ex) … … 1004 1006 return -1; 1005 1007 } 1008 #endif 1006 1009 1007 1010 static int … … 1156 1159 { 1157 1160 int retval; 1158 1159 //if (s->had_expunges) 1161 #ifdef SAVE_APPEND 1162 if (s->had_expunges) 1163 #endif 1160 1164 retval = camel_folder_summary_save_rewrite (s, ex); 1161 //else 1162 // retval = camel_folder_summary_save_append (s, ex); 1165 #ifdef SAVE_APPEND 1166 else 1167 retval = camel_folder_summary_save_append (s, ex); 1168 #endif 1163 1169 1164 1170 s->had_expunges = FALSE; trunk/libtinymail-camel/camel-lite/camel/camel-stream-buffer.c
r3130 r3235 34 34 #include "camel-stream-buffer.h" 35 35 #include "camel-tcp-stream.h" 36 37 #include "camel-operation.h" 36 38 37 39 static CamelStreamClass *parent_class = NULL; trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r3224 r3235 50 50 51 51 #include "camel-string-utils.h" 52 #include "camel-stream-buffer.h" 52 53 53 54 extern int camel_verbose_debug; … … 66 67 const char *fmt, ...); 67 68 68 69 #ifdef NOTUSED 69 70 static int 70 71 uid_compar (const void *va, const void *vb) … … 82 83 return 1; 83 84 } 85 86 #endif 84 87 85 88 /** trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3168 r3235 61 61 62 62 #include "camel-stream-fs.h" 63 63 #include "camel-utf8.h" 64 64 #include "camel-data-wrapper.h" 65 65 #include "camel-debug.h" … … 4484 4484 CamelImapFolder *imap_folder = (CamelImapFolder *) folder; 4485 4485 gchar *path = g_strdup_printf ("%s/%s_%s_CONVERTED", imap_folder->cache->path, uid, spec); 4486 gboolean retry = TRUE;4487 4486 gint ex_id; 4488 4487 gboolean err = FALSE, found = FALSE; … … 4506 4505 4507 4506 } else { 4508 CamelStreamBuffer *server_stream;4509 4507 int fd; 4510 4508 … … 4750 4748 } else { 4751 4749 4752 char *tag, line[MAX_LINE_LEN];4753 int taglen;4754 CamelStreamBuffer *server_stream;4755 4750 int fd; 4756 4751 … … 5160 5155 CamelImapResponse *response; 5161 5156 gint i = 0; gchar *resp; 5162 gboolean cont = FALSE;5163 5157 gboolean hdr_bin=FALSE; 5164 5158 … … 5473 5467 line += 7; 5474 5468 5475 body = imap_parse_nstring ((const char **) &line, &body_len);5469 body = imap_parse_nstring ((const char **) &line, (size_t *) &body_len); 5476 5470 if (body) { 5477 5471 done = TRUE; trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
r3070 r3235 187 187 if (p) 188 188 uid = g_strndup (dname, p - dname); 189 else if ( p = strchr (dname, '_'))189 else if ((p = strchr (dname, '_'))) 190 190 uid = g_strndup (dname, p - dname); 191 191 else trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store-summary.c
r3230 r3235 549 549 namespace_clear (s); 550 550 551 if (camel_file_util_decode_uint32(in, &count) == -1)551 if (camel_file_util_decode_uint32(in, (guint32 *) &count) == -1) 552 552 goto nserror; 553 553 … … 617 617 { 618 618 CamelImapStoreSummary *is = (CamelImapStoreSummary *)s; 619 gint32 version, capabilities , count;619 gint32 version, capabilities; 620 620 621 621 namespace_clear(s); … … 645 645 { 646 646 CamelImapStoreSummary *is = (CamelImapStoreSummary *)s; 647 guint32 count;648 647 649 648 /* always write as latest version */ trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r3207 r3235 1844 1844 CamelImapResponse *response; 1845 1845 /*struct _namespaces *namespaces;*/ 1846 char *result , *name;1846 char *result; 1847 1847 size_t len; 1848 1848 CamelImapStoreNamespace *ns; … … 2324 2324 } 2325 2325 2326 #ifdef NOT_USED 2326 2327 static void 2327 2328 camel_imap_store_set_status_for (CamelImapStore *imap_store, const char *folder_name, guint32 messages, guint32 unseen, guint32 uidnext) … … 2471 2472 } 2472 2473 2474 #endif 2473 2475 2474 2476 static void … … 3495 3497 3496 3498 /* We'll start with SELECT context */ 3497 prefix = g_strdup _printf("");3499 prefix = g_strdup (""); 3498 3500 3499 3501 /* We'll start with % if we know that there are other namespaces. … … 3700 3702 CamelFolderInfo *fi, *hfi; 3701 3703 char *list; 3702 int i, count , j;3704 int i, count; 3703 3705 GHashTable *present; 3704 3706 CamelStoreInfo *si; … … 4224 4226 4225 4227 4226 /* FIXME: please god, when will the hurting stop? Thus function is so4227 fucking broken it's not even funny. */4228 ssize_t4229 camel_imap_store_readline_idle (CamelImapStore *store, char **dest, CamelException *ex)4230 {4231 CamelStreamBuffer *stream;4232 char linebuf[1024] = {0};4233 GByteArray *ba;4234 ssize_t nread;4235 4236 g_return_val_if_fail (CAMEL_IS_IMAP_STORE (store), -1);4237 g_return_val_if_fail (dest, -1);4238 4239 *dest = NULL;4240 4241 /* Check for connectedness. Failed (or cancelled) operations will4242 * close the connection. We can't expect a read to have any4243 * meaning if we reconnect, so always set an exception.4244 */4245 4246 if (!camel_disco_store_check_online((CamelDiscoStore *)store, ex))4247 return -1;4248 4249 camel_imap_store_restore_stream_buffer (store);4250 stream = CAMEL_STREAM_BUFFER (store->istream);4251 4252 ba = g_byte_array_new ();4253 while ((nread = camel_stream_buffer_gets_idle (stream, linebuf, sizeof (linebuf))) > 0) {4254 g_byte_array_append (ba, (const guchar*) linebuf, nread);4255 if (linebuf[nread - 1] == '\n')4256 break;4257 }4258 4259 if (nread <= 0) {4260 if (errno == EINTR)4261 {4262 CamelException mex = CAMEL_EXCEPTION_INITIALISER;4263 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));4264 camel_imap_recon (store, &mex);4265 imap_debug ("Recon in idle: %s\n", camel_exception_get_description (&mex));4266 } else {4267 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,4268 _("Server unexpectedly disconnected: %s"),4269 g_strerror (errno));4270 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);4271 }4272 4273 g_byte_array_free (ba, TRUE);4274 return -1;4275 }4276 4277 if (camel_verbose_debug) {4278 fprintf (stderr, "received: ");4279 fwrite (ba->data, 1, ba->len, stderr);4280 }4281 4282 /* camel-imap-command.c:imap_read_untagged expects the CRLFs4283 to be stripped off and be nul-terminated *sigh* */4284 nread = ba->len - 1;4285 ba->data[nread] = '\0';4286 if (ba->data[nread - 1] == '\r') {4287 ba->data[nread - 1] = '\0';4288 nread--;4289 }4290 4291 *dest = (char *) ba->data;4292 g_byte_array_free (ba, FALSE);4293 4294 return nread;4295 }4296 4297 4228 ssize_t 4298 4229 camel_imap_store_readline_nl (CamelImapStore *store, char **dest, CamelException *ex) trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h
r3177 r3235 193 193 ssize_t camel_imap_store_readline_nb (CamelImapStore *store, char **dest, CamelException *ex); 194 194 ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex); 195 ssize_t camel_imap_store_readline_idle (CamelImapStore *store, char **dest, CamelException *ex);196 195 197 196 gboolean camel_imap_store_restore_stream_buffer (CamelImapStore *store); trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c
r3217 r3235 239 239 CamelMimeMessage *message = NULL; 240 240 CamelMessageInfo *info; 241 char *name, *filen; 242 gboolean nfree = FALSE; 241 char *name; 243 242 CamelMaildirMessageInfo *mdi; 244 243 trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c
r3218 r3235 204 204 { 205 205 const char *uid; 206 guint32 priority_flag = 0; /* 2 bits flags */207 206 char *p, *buf; 208 207 int i; … … 232 231 { 233 232 char *p, c; 234 guint32 priority_flag = 0; /* 2 bits flags */235 233 guint32 set = 0; /* what we set */ 236 234 int i; trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-engine.c
r3169 r3235 36 36 #include "camel-sasl.h" 37 37 #include "camel-service.h" 38 #include "camel-string-utils.h" 38 39 39 40 /* max 'outstanding' bytes in output stream, so we can't deadlock waiting … … 248 249 char *delay; 249 250 pe->capa |= CAMEL_POP3_CAP_LOGIN_DELAY; 250 delay = strchr ( line, ' ');251 delay = strchr ((const char *) line, ' '); 251 252 if (delay) { 252 253 delay++; trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c
r3126 r3235 272 272 { 273 273 CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store); 274 CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *) folder;275 274 CamelPOP3Command *pcl, *pcu = NULL; 276 275 int i, hcnt = 0, lcnt = 0; 277 CamelException dex = CAMEL_EXCEPTION_INITIALISER;278 276 CamelFolderChangeInfo *changes = NULL; 279 277 GList *deleted = NULL; … … 522 520 int i, max; 523 521 CamelMessageInfoBase *info; 524 CamelException dex = CAMEL_EXCEPTION_INITIALISER;525 522 GList *deleted = NULL; 526 523 CamelFolderChangeInfo *changes = NULL; … … 816 813 817 814 /* heuristics */ 818 if (camel_strstrcase ( buffer, "Content-Disposition: attachment") != NULL)815 if (camel_strstrcase ((const char *) buffer, "Content-Disposition: attachment") != NULL) 819 816 fi->has_attachments = TRUE; 820 else if (camel_strstrcase ( buffer, "filename=") != NULL &&821 strchr ( buffer, '.'))817 else if (camel_strstrcase ((const char *) buffer, "filename=") != NULL && 818 strchr ((const char *) buffer, '.')) 822 819 fi->has_attachments = TRUE; 823 else if (camel_strstrcase ( buffer, "Content-Type: message/rfc822") != NULL)820 else if (camel_strstrcase ((const char *) buffer, "Content-Type: message/rfc822") != NULL) 824 821 fi->has_attachments = TRUE; 825 822 … … 925 922 CamelFolderSummary *summary = folder->summary; 926 923 CamelMessageInfoBase *mi; gboolean im_certain=FALSE; 927 CamelException dex = CAMEL_EXCEPTION_INITIALISER;928 924 gint retry = 0; 929 925 gboolean had_attachment = FALSE; … … 1265 1261 CamelMimeMessage *message = NULL; 1266 1262 CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store); 1267 CamelPOP3Folder *pop3_folder = (CamelPOP3Folder *)folder;1268 1263 CamelPOP3Command *pcr; 1269 1264 CamelPOP3FolderInfo *fi; … … 1460 1455 pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set) 1461 1456 { 1462 CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);1463 1457 CamelPOP3FolderInfo *fi; 1464 1458 gboolean res = FALSE; trunk/libtinymail-camel/camel-lite/summary/summary.c
r3233 r3235 932 932 } 933 933 934 #ifdef DONT 934 935 static void 935 936 summary_dump (Summary *summary) … … 948 949 return; 949 950 } 951 #endif 950 952 951 953 static inline void … … 1106 1108 } 1107 1109 1110 #ifdef DONT 1108 1111 static void 1109 1112 foreach_item_print_it (gpointer key, gpointer value, gpointer user_data) … … 1134 1137 } 1135 1138 1136 #ifdef DONT1137 1139 1138 1140 int trunk/libtinymail-camel/tny-camel-account.c
r3125 r3235 1979 1979 __FUNCTION__); 1980 1980 } else { 1981 TnyCamelQueue *temp_queue = _tny_camel_queue_new (self);1981 /* TnyCamelQueue *temp_queue = _tny_camel_queue_new (self); */ 1982 1982 g_thread_create (tny_camel_account_get_supported_secure_authentication_async_thread, 1983 1983 info, FALSE, NULL); trunk/libtinymail-camel/tny-camel-bs-mime-part.c
r3171 r3235 545 545 DecodeAsyncInfo *info = (DecodeAsyncInfo *) user_data; 546 546 TnyCamelBsMimePartPriv *priv = TNY_CAMEL_BS_MIME_PART_GET_PRIVATE (info->self); 547 TnyCamelFolderPriv *fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (priv->folder);548 547 CamelOperation *cancel; 549 548 … … 644 643 tny_camel_bs_mime_part_construct_from_stream_default (TnyMimePart *self, TnyStream *stream, const gchar *type) 645 644 { 646 TnyCamelBsMimePartPriv *priv = TNY_CAMEL_BS_MIME_PART_GET_PRIVATE (self);647 645 return -1; 648 646 } trunk/libtinymail-camel/tny-camel-bs-msg-receive-strategy.c
r3070 r3235 70 70 { 71 71 TnyCamelBsMimePartPriv *ppriv = TNY_CAMEL_BS_MIME_PART_GET_PRIVATE (part); 72 TnyCamelFolderPriv *fpriv = TNY_CAMEL_FOLDER_GET_PRIVATE (folder);73 72 gchar *uid = ppriv->uid; 74 73 bodystruct_t *bodystruct = ppriv->bodystructure; … … 114 113 { 115 114 TnyMsg *message = NULL; 116 gchar *filename, *uid; 117 FILE *file; 115 gchar *uid; 118 116 CamelException ex = CAMEL_EXCEPTION_INITIALISER; 119 117 bodystruct_t *bodystructure = NULL; … … 136 134 137 135 if (structure_str) { 138 bodystructure = bodystruct_parse ( structure_str, strlen (structure_str),136 bodystructure = bodystruct_parse ((guchar *) structure_str, strlen (structure_str), 139 137 &parse_err); 140 138 if (parse_err) { trunk/libtinymail-camel/tny-camel-folder.c
r3186 r3235 2480 2480 TNY_FOLDER_ERROR_GET_MSG, 2481 2481 "Folder not ready for getting messages"); 2482 return ;2482 return NULL; 2483 2483 } 2484 2484 … … 2546 2546 TNY_FOLDER_ERROR_GET_MSG, 2547 2547 "Folder not ready for finding messages"); 2548 return ;2548 return NULL; 2549 2549 } 2550 2550 … … 3222 3222 TNY_FOLDER_ERROR_COPY, 3223 3223 "Folder not ready for copy"); 3224 return ;3224 return NULL; 3225 3225 } 3226 3226 trunk/libtinymail-camel/tny-camel-imap-folder.c
r3074 r3235 91 91 tny_camel_imap_folder_instance_init (GTypeInstance *instance, gpointer g_class) 92 92 { 93 #ifdef IMAP_PART_FETCH 93 94 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (instance); 94 95 #ifdef IMAP_PART_FETCH96 95 97 96 /* By default disabled until after the first release */ trunk/libtinymail-camel/tny-camel-mime-part.c
r3171 r3235 677 677 "tny_mime_part_construct_from_stream first")); 678 678 camel_object_unref (CAMEL_OBJECT (cstream)); 679 return ;679 return -1; 680 680 } 681 681 trunk/libtinymail-camel/tny-camel-msg-header.c
r3137 r3235 22 22 #include <glib/gi18n-lib.h> 23 23 24 #include <ctype.h> 24 25 #include <glib.h> 25 26 #include <string.h> trunk/libtinymail-camel/tny-camel-queue.c
r2993 r3235 264 264 _tny_camel_queue_remove_items (TnyCamelQueue *queue, TnyCamelQueueItemFlags flags) 265 265 { 266 GList *copy = NULL , *rem = NULL;266 GList *copy = NULL; 267 267 268 268 g_static_rec_mutex_lock (queue->lock); trunk/libtinymail/tny-folder-monitor.c
r3161 r3235 197 197 remove_headers_from_list (TnyList *list, GPtrArray *array) 198 198 { 199 TnyIterator *iter;200 TnyHeader *header = NULL;201 199 gint i=0; 202 200 trunk/libtinymail/tny-header.c
r3161 r3235 567 567 { 568 568 TnyHeaderFlags flags; 569 g_return_if_fail ( priority & TNY_HEADER_FLAG_PRIORITY_MASK!= priority);569 g_return_if_fail ((priority & TNY_HEADER_FLAG_PRIORITY_MASK) != priority); 570 570 571 571 /* Is this necessary? */ trunk/libtinymail/tny-mime-part.c
r3171 r3235 600 600 * will get a non-encoded version of the data. A small difference will be that 601 601 * the tny_mime_part_decode_to_stream() will decode certain special characters in 602 * TEXT /*mime parts (character set encoding) to UTF-8.602 * TEXT mime parts (character set encoding) to UTF-8. 603 603 * 604 604 * However. A larger difference happens with binary mime parts that where not … … 652 652 * received using FETCH BODY and the data is encoded in a known encoding 653 653 * (like BASE 64, QUOTED-PRINTED, UUENCODED, etc), the data will be decoded 654 * before delivered to @stream. TEXT /*mime parts will also enjoy character set654 * before delivered to @stream. TEXT mime parts will also enjoy character set 655 655 * decoding. 656 656 * trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
r3228 r3235 43 43 44 44 #include <config.h> 45 #include <string.h> 45 46 46 47 #include <glib.h> … … 113 114 TnyIterator *iter; 114 115 TnyList *folders = tny_simple_list_new (); 115 TnyGtkFolderStoreTreeModel *me = (TnyGtkFolderStoreTreeModel*) self;116 116 117 117 /* TODO add error checking and reporting here */ … … 524 524 { 525 525 TnyGtkFolderStoreTreeModel *me = (TnyGtkFolderStoreTreeModel*) object; 526 GList *copy = me->fol_obs;527 526 /* 528 527 if (me->signal1 != -1) … … 923 922 creater (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *in_iter, gpointer user_data) 924 923 { 925 TnyGtkFolderStoreTreeModel *me = (TnyGtkFolderStoreTreeModel*) model;926 924 TnyGtkFolderStoreTreeModel *self = (TnyGtkFolderStoreTreeModel*) model; 927 925 TnyFolderStore *fol = NULL; … … 1070 1068 TnyFolderStoreChangeChanged changed = tny_folder_store_change_get_changed (change); 1071 1069 GtkTreeModel *model = GTK_TREE_MODEL (self); 1072 TnyGtkFolderStoreTreeModel *me = (TnyGtkFolderStoreTreeModel*) self;1073 1070 1074 1071 if (changed & TNY_FOLDER_STORE_CHANGE_CHANGED_CREATED_FOLDERS) { trunk/libtinymailui-gtk/tny-gtk-msg-view.c
r3163 r3235 466 466 467 467 /* Attachments */ 468 } else if ( priv->display_attachments && tny_mime_part_is_attachment (part) ||468 } else if ((priv->display_attachments && tny_mime_part_is_attachment (part)) || 469 469 (priv->display_rfc822 && (tny_mime_part_content_type_is (part, "message/rfc822")))) 470 470 {
