changeset 13519:d6dd68a8be06

[gaim-migrate @ 15895] The error message when using an invalid browser command should not escape HTML stuffs. Patch from Bjoern Voigt. Richard, can you add the gtknotify.c changes to your list of stuff to tweak after we're out of the string freeze? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 16 Mar 2006 04:27:00 +0000
parents cd21f1738063
children c836ba676c7c
files src/gtkconv.c src/gtknotify.c src/log.c
diffstat 3 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Wed Mar 15 18:25:36 2006 +0000
+++ b/src/gtkconv.c	Thu Mar 16 04:27:00 2006 +0000
@@ -8211,7 +8211,7 @@
 	{
 		GdkColor color = { 0, rand() % 65536, rand() % 65536, rand() % 65536 };
 
-		gaim_debug(GAIM_DEBUG_WARNING, NULL,
+		gaim_debug_warning("gtkconv",
 				   "Looking for random colors to fill the list, I have found %i so far.\n",i);
 
 		if (color_is_visible(color, background,     MIN_COLOR_CONTRAST,     MIN_BRIGHTNESS_CONTRAST) &&
@@ -8225,11 +8225,10 @@
 
 	if (i < numcolors) {
 		GdkColor *c = colors;
-		gaim_debug(GAIM_DEBUG_WARNING, NULL, "Unable to generate enough random colors before timeout. %u colors found.\n", i);
+		gaim_debug_warning("gtkconv", "Unable to generate enough random colors before timeout. %u colors found.\n", i);
 		colors = g_memdup(c, i * sizeof(GdkColor));
 		g_free(c);
 		*color_count = i;
-		
 	}
 
 	return colors;
--- a/src/gtknotify.c	Wed Mar 15 18:25:36 2006 +0000
+++ b/src/gtknotify.c	Thu Mar 16 04:27:00 2006 +0000
@@ -870,17 +870,17 @@
 static gint
 uri_command(const char *command, gboolean sync)
 {
-	gchar *escaped, *tmp;
+	gchar *tmp;
 	GError *error = NULL;
 	gint ret = 0;
 
-	escaped = g_markup_escape_text(command, -1);
-	gaim_debug_misc("gtknotify", "Executing %s\n", escaped);
+	gaim_debug_misc("gtknotify", "Executing %s\n", command);
 
 	if (!gaim_program_is_valid(command))
 	{
+		/* TODO: Change the bold tags to quotes when not in string freeze */
 		tmp = g_strdup_printf(_("The browser command <b>%s</b> is invalid."),
-							  escaped ? escaped : "(none)");
+							  command ? command : "(none)");
 		gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp);
 		g_free(tmp);
 
@@ -891,8 +891,9 @@
 
 		if (!g_spawn_command_line_sync(command, NULL, NULL, &status, &error))
 		{
+			/* TODO: Change the bold tags to quotes when not in string freeze */
 			tmp = g_strdup_printf(_("Error launching <b>%s</b>: %s"),
-										escaped, error->message);
+										command, error->message);
 			gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp);
 			g_free(tmp);
 			g_error_free(error);
@@ -904,16 +905,15 @@
 	{
 		if (!g_spawn_command_line_async(command, &error))
 		{
+			/* TODO: Change the bold tags to quotes when not in string freeze */
 			tmp = g_strdup_printf(_("Error launching <b>%s</b>: %s"),
-										escaped, error->message);
+										command, error->message);
 			gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp);
 			g_free(tmp);
 			g_error_free(error);
 		}
 	}
 
-	g_free(escaped);
-
 	return ret;
 }
 #endif /* _WIN32 */
--- a/src/log.c	Wed Mar 15 18:25:36 2006 +0000
+++ b/src/log.c	Thu Mar 16 04:27:00 2006 +0000
@@ -1100,7 +1100,7 @@
 		} else {
 			gaim_debug_error("log", "Unhandled message type.");
 			written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n",
-                        		date, from, msg_fixed);
+						date, from, msg_fixed);
 		}
 	}
 	g_free(date);