gtkhtml r8702 - branches/mbarnes-composer/components/editor



Author: mbarnes
Date: Mon Jan 28 03:17:16 2008
New Revision: 8702
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8702&view=rev

Log:
Minor integration bugs and some other stuff that was laying around.


Modified:
   branches/mbarnes-composer/components/editor/gtkhtml-editor.c
   branches/mbarnes-composer/components/editor/gtkhtml-editor.h
   branches/mbarnes-composer/components/editor/gtkhtml-editor.ui
   branches/mbarnes-composer/components/editor/gtkhtml-spell-language.c

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor.c
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor.c	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor.c	Mon Jan 28 03:17:16 2008
@@ -157,7 +157,8 @@
                          GtkHTMLStream *stream)
 {
 	GtkHTML *html;
-	GMappedFile *file;
+	GMappedFile *mapped_file;
+	GtkHTMLStreamStatus status;
 	gchar *filename = NULL;
 	GError *error = NULL;
 
@@ -170,29 +171,31 @@
 	}
 
 	filename = g_filename_from_uri (url, NULL, &error);
-	if (error != NULL) {
-		g_warning ("%s", error->message);
-		g_error_free (error);
+	if (filename == NULL)
 		goto exit;
-	}
 
-	file = g_mapped_file_new (filename, FALSE, &error);
-	if (error != NULL) {
-		g_warning ("%s", error->message);
-		g_error_free (error);
+	mapped_file = g_mapped_file_new (filename, FALSE, &error);
+	if (mapped_file == NULL)
 		goto exit;
-	}
 
 	gtk_html_write (
 		html, stream,
-		g_mapped_file_get_contents (file),
-		g_mapped_file_get_length (file));
+		g_mapped_file_get_contents (mapped_file),
+		g_mapped_file_get_length (mapped_file));
 
-	gtk_html_end (html, stream, GTK_HTML_STREAM_OK);
-
-	g_mapped_file_free (file);
+	g_mapped_file_free (mapped_file);
 
 exit:
+	if (error == NULL)
+		status = GTK_HTML_STREAM_OK;
+	else {
+		status = GTK_HTML_STREAM_ERROR;
+		g_warning ("%s", error->message);
+		g_error_free (error);
+	}
+
+	gtk_html_end (html, stream, status);
+
 	g_free (filename);
 }
 

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor.h
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor.h	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor.h	Mon Jan 28 03:17:16 2008
@@ -21,7 +21,7 @@
 #ifndef GTKHTML_EDITOR_H
 #define GTKHTML_EDITOR_H
 
-#include <gtkhtml.h>
+#include <gtkhtml/gtkhtml.h>
 
 #include <gtkhtml-editor-common.h>
 #include <gtkhtml-editor-actions.h>

Modified: branches/mbarnes-composer/components/editor/gtkhtml-editor.ui
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-editor.ui	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-editor.ui	Mon Jan 28 03:17:16 2008
@@ -97,6 +97,7 @@
     </menu>
   </menubar>
   <toolbar name='main-toolbar'>
+    <placeholder name='pre-main-toolbar'/>
     <toolitem action='undo'/>
     <toolitem action='redo'/>
     <separator/>

Modified: branches/mbarnes-composer/components/editor/gtkhtml-spell-language.c
==============================================================================
--- branches/mbarnes-composer/components/editor/gtkhtml-spell-language.c	(original)
+++ branches/mbarnes-composer/components/editor/gtkhtml-spell-language.c	Mon Jan 28 03:17:16 2008
@@ -118,26 +118,26 @@
                  const gchar *basename,
 		 GHashTable *hash_table)
 {
-	GMappedFile *file;
+	GMappedFile *mapped_file;
 	gchar *filename;
 	GError *error = NULL;
 
 	filename = g_build_filename (
 		ISO_CODES_PREFIX, "share", "xml",
 		"iso-codes", basename, NULL);
-	file = g_mapped_file_new (filename, FALSE, &error);
+	mapped_file = g_mapped_file_new (filename, FALSE, &error);
 	g_free (filename);
 
-	if (file != NULL) {
+	if (mapped_file != NULL) {
 		GMarkupParseContext *context;
 
 		context = g_markup_parse_context_new (
 			parser, 0, hash_table, NULL);
 		g_markup_parse_context_parse (
-			context, g_mapped_file_get_contents (file),
-			g_mapped_file_get_length (file), &error);
+			context, g_mapped_file_get_contents (mapped_file),
+			g_mapped_file_get_length (mapped_file), &error);
 		g_markup_parse_context_free (context);
-		g_mapped_file_free (file);
+		g_mapped_file_free (mapped_file);
 	}
 
 	if (error != NULL) {



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