[PATCH] Some misc fixes



---
 ChangeLog                                          |   16 +++-
 .../tny-camel-default-connection-policy.c          |   19 ++++-
 libtinymail-gnomevfs/tny-vfs-stream.c              |    5 +-
 libtinymail-maemo/tny-maemo-device.c               |    5 +-
 .../tny-gtk-html-mime-part-view.c                  |   88 --------------------
 5 files changed, 39 insertions(+), 94 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c61a706..6f2f3ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,20 @@
+2008-11-21  Sergio Villar Senin  <svillar iglaia com>
+
+	* libtinymail-camel/tny-camel-default-connection-policy.c: added
+	missing license
+	* libtinymail-gnomevfs/tny-vfs-stream.c: prevent a double free of a
+	file pointer
+	* libtinymail-maemo/tny-maemo-device.c: added missing initialization
+	* libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c: added missing
+	initialization
+
 2008-11-21  Martin Bonnin  <martinbonnin gmail com>
- 
+
 	* revert last changeset:
-	We want this to be fixed a better way
+	We want this to be fixed a better way	 
 
 2008-11-20  Martin Bonnin  <martinbonnin gmail com>
- 
+
 	* camel operation:
 	adding camel_operation_mute/unmute() and use it to filter the progress
 	events. This prevents to send bad progress when refreshing an IMAP folder
diff --git a/libtinymail-camel/tny-camel-default-connection-policy.c b/libtinymail-camel/tny-camel-default-connection-policy.c
index d85b92f..43710eb 100644
--- a/libtinymail-camel/tny-camel-default-connection-policy.c
+++ b/libtinymail-camel/tny-camel-default-connection-policy.c
@@ -1,4 +1,21 @@
-/* Your copyright here */
+/* libtinymail-camel - The Tiny Mail base library for Camel
+ * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof gnome org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with self library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
 
 #include <config.h>
 #include <glib.h>
diff --git a/libtinymail-gnomevfs/tny-vfs-stream.c b/libtinymail-gnomevfs/tny-vfs-stream.c
index ce33c5b..410c618 100644
--- a/libtinymail-gnomevfs/tny-vfs-stream.c
+++ b/libtinymail-gnomevfs/tny-vfs-stream.c
@@ -246,8 +246,10 @@ tny_vfs_stream_set_handle (TnyVfsStream *self, GnomeVFSHandle *handle)
 {
 	TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self);
 
-	if (priv->handle)
+	if (priv->handle) {
 		gnome_vfs_close (priv->handle);
+		priv->handle = NULL;
+	}
 
 	if (!handle)
 		return;
@@ -288,6 +290,7 @@ tny_vfs_stream_instance_init (GTypeInstance *instance, gpointer g_class)
 	priv->handle = NULL;
 	priv->bound_start = 0;
 	priv->bound_end = (~0);
+	priv->position = 0;
 
 	return;
 }
diff --git a/libtinymail-maemo/tny-maemo-device.c b/libtinymail-maemo/tny-maemo-device.c
index c37a69e..1a64d16 100644
--- a/libtinymail-maemo/tny-maemo-device.c
+++ b/libtinymail-maemo/tny-maemo-device.c
@@ -139,7 +139,10 @@ tny_maemo_device_is_online (TnyDevice *self)
 static void
 tny_maemo_device_instance_init (GTypeInstance *instance, gpointer g_class)
 {
-	return;
+	TnyMaemoDevicePriv *priv = TNY_MAEMO_DEVICE_GET_PRIVATE (instance);
+
+	priv->forced = FALSE;
+	priv->fset = FALSE;
 }
 
 
diff --git a/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c b/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c
index 0a5f20b..cf2ea26 100644
--- a/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c
+++ b/libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c
@@ -135,100 +135,12 @@ tny_gtk_html_mime_part_view_clear (TnyMimePartView *self)
 	return;
 }
 
-
-
-
-#if 0
-typedef struct {
-	gpointer buffer;
-	GtkHTML *html;
-	GtkHTMLStream *stream;
-	gboolean html_finalized;
-} ImageFetcherInfo;
-
-static void
-html_finalized_notify (ImageFetcherInfo *ifinfo,
-		       GObject *destroyed)
-{
-	ifinfo->html_finalized = TRUE;
-}
-
-static void
-image_fetcher_close (GnomeVFSAsyncHandle *handle,
-		     GnomeVFSResult result,
-		     gpointer data)
-{
-}
-
-static void
-image_fetcher_read (GnomeVFSAsyncHandle *handle,
-		    GnomeVFSResult result,
-		    gpointer buffer,
-		    GnomeVFSFileSize bytes_requested,
-		    GnomeVFSFileSize bytes_read,
-		    ImageFetcherInfo *ifinfo)
-{
-
-	if (ifinfo->html_finalized || result != GNOME_VFS_OK) {
-		gnome_vfs_async_close (handle, (GnomeVFSAsyncCloseCallback) image_fetcher_close, (gpointer) NULL);
-		if (!ifinfo->html_finalized) {
-			gtk_html_stream_close (ifinfo->stream, GTK_HTML_STREAM_OK);
-			g_object_weak_unref ((GObject *) ifinfo->html, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);
-		}
-		g_slice_free1 (128, ifinfo->buffer);
-		g_slice_free (ImageFetcherInfo, ifinfo);
-		return;
-	}
-	gtk_html_stream_write (ifinfo->stream, buffer, bytes_read);
-	gnome_vfs_async_read (handle, ifinfo->buffer, 128, 
-			      (GnomeVFSAsyncReadCallback)image_fetcher_read, ifinfo);
-	return;
-}
-
-static void
-image_fetcher_open (GnomeVFSAsyncHandle *handle,
-		    GnomeVFSResult result,
-		    ImageFetcherInfo *ifinfo)
-{
-	if (!ifinfo->html_finalized && result == GNOME_VFS_OK) {
-		ifinfo->buffer = g_slice_alloc (128);
-		gnome_vfs_async_read (handle, ifinfo->buffer, 128, 
-				      (GnomeVFSAsyncReadCallback) image_fetcher_read, ifinfo);
-	} else {
-		if (!ifinfo->html_finalized) {
-			gtk_html_stream_close (ifinfo->stream, GTK_HTML_STREAM_OK);
-			g_object_weak_unref ((GObject *) ifinfo->html, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);
-		}
-		g_slice_free (ImageFetcherInfo, ifinfo);
-	}
-}
-
-#endif
-
 static gboolean
 on_url_requested (GtkWidget *widget, const gchar *uri, GtkHTMLStream *stream, TnyMimePartView *self)
 {
 	gboolean result;
 	TnyStream *tny_stream;
 
-#if 0
-	if (g_str_has_prefix (uri, "http:") && TRUE /* TODO: make optional */) {
-		GnomeVFSAsyncHandle *handle;
-		ImageFetcherInfo *ifinfo;
-
-		ifinfo = g_slice_new (ImageFetcherInfo);
-		ifinfo->html_finalized = FALSE;
-		ifinfo->html = (GtkHTML *) self;
-		ifinfo->buffer = NULL;
-		ifinfo->stream = stream;
-		g_object_weak_ref ((GObject *) self, (GWeakNotify) html_finalized_notify, (gpointer) ifinfo);
-		gnome_vfs_async_open (&handle, uri, GNOME_VFS_OPEN_READ,
-				      GNOME_VFS_PRIORITY_DEFAULT, 
-				      (GnomeVFSAsyncOpenCallback) image_fetcher_open, ifinfo);
-		return FALSE;
-	}
-#endif
-
 	tny_stream = TNY_STREAM (tny_gtk_html_stream_new (stream));
 	g_signal_emit_by_name (self, "fetch-url", uri, tny_stream, &result);
 	gtk_html_stream_close (stream, result?GTK_HTML_STREAM_OK:GTK_HTML_STREAM_ERROR);
-- 
1.5.2.4


--------------090902090604040409000509--


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]