Changeset 316
- Timestamp:
- 05/15/06 21:35:28
- Files:
-
- trunk/libtinymail-camel/tny-msg-mime-part.c (modified) (4 diffs)
- trunk/libtinymail-gnome-desktop/tny-moz-embed-msg-view.c (modified) (2 diffs)
- trunk/libtinymail-gnomevfs/tny-vfs-stream.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-msg-mime-part.c
r315 r316 117 117 camel_stream_format_text (CamelDataWrapper *dw, CamelStream *stream) 118 118 { 119 /* Stolen from evolution, evil evil me!! moehahah */ 120 119 121 CamelStreamFilter *filter_stream; 120 122 CamelMimeFilterCharset *filter; 121 const char *charset = "UTF-8"; 123 const char *charset = "UTF-8"; /* I default to UTF-8, like it or not */ 122 124 CamelMimeFilterWindows *windows = NULL; 123 125 … … 162 164 if (windows) 163 165 camel_object_unref(windows); 166 167 return; 164 168 } 165 169 … … 168 172 tny_msg_mime_part_decode_to_stream (TnyMsgMimePartIface *self, TnyStreamIface *stream) 169 173 { 170 /* TODO: Add a filter (decoder) here */171 174 172 175 TnyMsgMimePartPriv *priv = TNY_MSG_MIME_PART_GET_PRIVATE (self); … … 193 196 } 194 197 195 /* camel_stream_reset (wrapper->stream);196 camel_stream_write_to_stream (wrapper->stream, cstream); */197 198 198 if (camel_content_type_is (wrapper->mime_type, "text", "*")) 199 199 camel_stream_format_text (wrapper, cstream); 200 200 else 201 201 camel_data_wrapper_decode_to_stream (wrapper, cstream); 202 203 /* This should work but doesn't . . .204 camel_data_wrapper_write_to_stream (wrapper, cstream); */205 202 206 203 camel_object_unref (CAMEL_OBJECT (cstream)); trunk/libtinymail-gnome-desktop/tny-moz-embed-msg-view.c
r314 r316 216 216 217 217 /* TODO: Add a filter (decoder) here (depends on encoding) */ 218 219 218 tny_msg_mime_part_iface_decode_to_stream (part, TNY_STREAM_IFACE (stream)); 220 219 … … 233 232 GtkTreeIter iter; 234 233 235 if (G_LIKELY (gtk_tree_model_get_iter (model, &iter, path)))234 if (G_LIKELY (gtk_tree_model_get_iter (model, &iter, path))) 236 235 { 237 236 TnyMsgMimePartIface *part; trunk/libtinymail-gnomevfs/tny-vfs-stream.c
r212 r316 56 56 { 57 57 GnomeVFSHandle *handle; 58 gboolean eos; 58 59 }; 59 60 … … 198 199 if (G_LIKELY (res == GNOME_VFS_OK)) 199 200 { 201 priv->eos = FALSE; 200 202 return (ssize_t)count; 201 203 202 204 } else if (G_LIKELY (res == GNOME_VFS_ERROR_EOF)) 203 205 { 204 /*TODO: stream->eos = TRUE; Handle this */205 return 0;206 priv->eos = TRUE; 207 return (ssize_t)count; 206 208 } 207 209 … … 225 227 226 228 res = gnome_vfs_write (priv->handle, buffer, n, &count); 227 228 229 if (G_LIKELY (res == GNOME_VFS_OK)) 229 230 return (ssize_t)count; … … 366 367 TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 367 368 369 priv->eos = FALSE; 368 370 priv->handle = NULL; 369 371 … … 385 387 } 386 388 389 static gint 390 tny_vfs_flush (TnyStreamIface *self) 391 { 392 return 0; 393 } 394 395 static gboolean 396 tny_vfs_eos (TnyStreamIface *self) 397 { 398 TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 399 400 return priv->eos; 401 } 402 403 static gint 404 tny_vfs_reset (TnyStreamIface *self) 405 { 406 TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 407 gint retval = -1; 408 GnomeVFSResult res; 409 410 if (priv->handle == NULL) 411 { 412 errno = EINVAL; 413 return -1; 414 } 415 416 res = gnome_vfs_seek (priv->handle, GNOME_VFS_SEEK_START, 0); 417 418 if (res != GNOME_VFS_OK) 419 { 420 tny_vfs_stream_set_errno (res); 421 retval = -1; 422 } 423 424 return retval; 425 } 426 387 427 static void 388 428 tny_stream_iface_init (gpointer g_iface, gpointer iface_data) 389 429 { 390 430 TnyStreamIfaceClass *klass = (TnyStreamIfaceClass *)g_iface; 431 432 klass->reset_func = tny_vfs_reset; 433 klass->flush_func = tny_vfs_flush; 434 klass->eos_func = tny_vfs_eos; 391 435 392 436 klass->read_func = tny_vfs_stream_read;
