Changeset 3823

Show
Ignore:
Timestamp:
11/21/08 18:01:16
Author:
svillar
Message:

Some misc fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3822 r3823  
     12008-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 
    1112008-11-21  Martin Bonnin  <martinbonnin@gmail.com> 
    212  
     
    616  
    717        * revert last changeset: 
    8         We want this to be fixed a better way 
     18        We want this to be fixed a better way    
    919 
    10202008-11-20  Martin Bonnin  <martinbonnin@gmail.com> 
    11   
     21 
    1222        * camel operation: 
    1323        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 */ 
    219 
    320#include <config.h> 
  • trunk/libtinymail-gnomevfs/tny-vfs-stream.c

    r3666 r3823  
    247247        TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 
    248248 
    249         if (priv->handle) 
     249        if (priv->handle) { 
    250250                gnome_vfs_close (priv->handle); 
     251                priv->handle = NULL; 
     252        } 
    251253 
    252254        if (!handle) 
     
    289291        priv->bound_start = 0; 
    290292        priv->bound_end = (~0); 
     293        priv->position = 0; 
    291294 
    292295        return; 
  • trunk/libtinymail-maemo/tny-maemo-device.c

    r3666 r3823  
    140140tny_maemo_device_instance_init (GTypeInstance *instance, gpointer g_class) 
    141141{ 
    142         return; 
     142        TnyMaemoDevicePriv *priv = TNY_MAEMO_DEVICE_GET_PRIVATE (instance); 
     143 
     144        priv->forced = FALSE; 
     145        priv->fset = FALSE; 
    143146} 
    144147 
  • trunk/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c

    r3666 r3823  
    136136} 
    137137 
    138  
    139  
    140  
    141 #if 0 
    142 typedef struct { 
    143         gpointer buffer; 
    144         GtkHTML *html; 
    145         GtkHTMLStream *stream; 
    146         gboolean html_finalized; 
    147 } ImageFetcherInfo; 
    148  
    149 static void 
    150 html_finalized_notify (ImageFetcherInfo *ifinfo, 
    151                        GObject *destroyed) 
    152 { 
    153         ifinfo->html_finalized = TRUE; 
    154 } 
    155  
    156 static void 
    157 image_fetcher_close (GnomeVFSAsyncHandle *handle, 
    158                      GnomeVFSResult result, 
    159                      gpointer data) 
    160 { 
    161 } 
    162  
    163 static void 
    164 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 void 
    189 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 #endif 
    207  
    208138static gboolean 
    209139on_url_requested (GtkWidget *widget, const gchar *uri, GtkHTMLStream *stream, TnyMimePartView *self) 
     
    211141        gboolean result; 
    212142        TnyStream *tny_stream; 
    213  
    214 #if 0 
    215         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 #endif 
    231143 
    232144        tny_stream = TNY_STREAM (tny_gtk_html_stream_new (stream));