Changeset 3823
- Timestamp:
- 11/21/08 18:01:16
- Files:
-
- trunk/ChangeLog (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-default-connection-policy.c (modified) (1 diff)
- trunk/libtinymail-gnomevfs/tny-vfs-stream.c (modified) (2 diffs)
- trunk/libtinymail-maemo/tny-maemo-device.c (modified) (1 diff)
- trunk/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3822 r3823 1 2008-11-21 Sergio Villar Senin <svillar@iglaia.com> 2 3 * libtinymail-camel/tny-camel-default-connection-policy.c: added 4 missing license 5 * libtinymail-gnomevfs/tny-vfs-stream.c: prevent a double free of a 6 file pointer 7 * libtinymail-maemo/tny-maemo-device.c: added missing initialization 8 * libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c: added missing 9 initialization 10 1 11 2008-11-21 Martin Bonnin <martinbonnin@gmail.com> 2 12 … … 6 16 7 17 * revert last changeset: 8 We want this to be fixed a better way 18 We want this to be fixed a better way 9 19 10 20 2008-11-20 Martin Bonnin <martinbonnin@gmail.com> 11 21 12 22 * camel operation: 13 23 adding camel_operation_mute/unmute() and use it to filter the progress trunk/libtinymail-camel/tny-camel-default-connection-policy.c
r3666 r3823 1 /* Your copyright here */ 1 /* libtinymail-camel - The Tiny Mail base library for Camel 2 * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with self library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 2 19 3 20 #include <config.h> trunk/libtinymail-gnomevfs/tny-vfs-stream.c
r3666 r3823 247 247 TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 248 248 249 if (priv->handle) 249 if (priv->handle) { 250 250 gnome_vfs_close (priv->handle); 251 priv->handle = NULL; 252 } 251 253 252 254 if (!handle) … … 289 291 priv->bound_start = 0; 290 292 priv->bound_end = (~0); 293 priv->position = 0; 291 294 292 295 return; trunk/libtinymail-maemo/tny-maemo-device.c
r3666 r3823 140 140 tny_maemo_device_instance_init (GTypeInstance *instance, gpointer g_class) 141 141 { 142 return; 142 TnyMaemoDevicePriv *priv = TNY_MAEMO_DEVICE_GET_PRIVATE (instance); 143 144 priv->forced = FALSE; 145 priv->fset = FALSE; 143 146 } 144 147 trunk/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c
r3666 r3823 136 136 } 137 137 138 139 140 141 #if 0142 typedef struct {143 gpointer buffer;144 GtkHTML *html;145 GtkHTMLStream *stream;146 gboolean html_finalized;147 } ImageFetcherInfo;148 149 static void150 html_finalized_notify (ImageFetcherInfo *ifinfo,151 GObject *destroyed)152 {153 ifinfo->html_finalized = TRUE;154 }155 156 static void157 image_fetcher_close (GnomeVFSAsyncHandle *handle,158 GnomeVFSResult result,159 gpointer data)160 {161 }162 163 static void164 image_fetcher_read (GnomeVFSAsyncHandle *handle,165 GnomeVFSResult result,166 gpointer buffer,167 GnomeVFSFileSize bytes_requested,168 GnomeVFSFileSize bytes_read,169 ImageFetcherInfo *ifinfo)170 {171 172 if (ifinfo->html_finalized || result != GNOME_VFS_OK) {173 gnome_vfs_async_close (handle, (GnomeVFSAsyncCloseCallback) image_fetcher_close, (gpointer) NULL);174 if (!ifinfo->html_finalized) {175 gtk_html_stream_close (ifinfo->stream, GTK_HTML_STREAM_OK);176 g_object_weak_unref ((GObject *) ifinfo->html, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);177 }178 g_slice_free1 (128, ifinfo->buffer);179 g_slice_free (ImageFetcherInfo, ifinfo);180 return;181 }182 gtk_html_stream_write (ifinfo->stream, buffer, bytes_read);183 gnome_vfs_async_read (handle, ifinfo->buffer, 128,184 (GnomeVFSAsyncReadCallback)image_fetcher_read, ifinfo);185 return;186 }187 188 static void189 image_fetcher_open (GnomeVFSAsyncHandle *handle,190 GnomeVFSResult result,191 ImageFetcherInfo *ifinfo)192 {193 if (!ifinfo->html_finalized && result == GNOME_VFS_OK) {194 ifinfo->buffer = g_slice_alloc (128);195 gnome_vfs_async_read (handle, ifinfo->buffer, 128,196 (GnomeVFSAsyncReadCallback) image_fetcher_read, ifinfo);197 } else {198 if (!ifinfo->html_finalized) {199 gtk_html_stream_close (ifinfo->stream, GTK_HTML_STREAM_OK);200 g_object_weak_unref ((GObject *) ifinfo->html, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);201 }202 g_slice_free (ImageFetcherInfo, ifinfo);203 }204 }205 206 #endif207 208 138 static gboolean 209 139 on_url_requested (GtkWidget *widget, const gchar *uri, GtkHTMLStream *stream, TnyMimePartView *self) … … 211 141 gboolean result; 212 142 TnyStream *tny_stream; 213 214 #if 0215 if (g_str_has_prefix (uri, "http:") && TRUE /* TODO: make optional */) {216 GnomeVFSAsyncHandle *handle;217 ImageFetcherInfo *ifinfo;218 219 ifinfo = g_slice_new (ImageFetcherInfo);220 ifinfo->html_finalized = FALSE;221 ifinfo->html = (GtkHTML *) self;222 ifinfo->buffer = NULL;223 ifinfo->stream = stream;224 g_object_weak_ref ((GObject *) self, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);225 gnome_vfs_async_open (&handle, uri, GNOME_VFS_OPEN_READ,226 GNOME_VFS_PRIORITY_DEFAULT,227 (GnomeVFSAsyncOpenCallback) image_fetcher_open, ifinfo);228 return FALSE;229 }230 #endif231 143 232 144 tny_stream = TNY_STREAM (tny_gtk_html_stream_new (stream));
