/cpw/tomkiewicz/gg11: e764b8a726de: Merge from trunk
Tomasz Wasilczyk
tomkiewicz at cpw.pidgin.im
Tue Sep 11 07:12:48 EDT 2012
Changeset: e764b8a726dec50734c522ed6c3bc129117395bd
Author: Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date: 2012-09-11 12:58 +0200
Branch: default
URL: http://hg.pidgin.im/cpw/tomkiewicz/gg11/rev/e764b8a726de
Description:
Merge from trunk
diffstat:
configure.ac | 11 +-
finch/gntsound.c | 2 +-
libpurple/dnsquery.c | 21 +-
libpurple/tests/test_util.c | 165 +++++++++++++++++
libpurple/util.c | 63 +++--
pidgin/gtkblist.c | 7 +-
pidgin/gtkconv-theme.c | 45 ++++
pidgin/gtkconv-theme.h | 9 +
pidgin/gtkconv.c | 72 ++++--
pidgin/gtkconv.h | 1 +
pidgin/gtkmain.c | 56 +-----
pidgin/gtkpounce.c | 30 +--
pidgin/gtksound.c | 5 +-
pidgin/themes/Contents/Resources/Incoming/Content.html | 8 +
pidgin/themes/Contents/Resources/main.css | 5 +-
pidgin/themes/Makefile.am | 3 +
valgrind-suppressions | 15 +-
17 files changed, 358 insertions(+), 160 deletions(-)
diffs (truncated from 949 to 300 lines):
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -836,9 +836,6 @@ AM_GCONF_SOURCE_2
dnl #######################################################################
dnl # Check for GStreamer
dnl #######################################################################
-dnl
-dnl TODO: Depend on gstreamer >= 0.10.10, and remove the conditional use of
-dnl gst_registry_fork_set_enabled.
AC_ARG_ENABLE(gstreamer,
[AC_HELP_STRING([--disable-gstreamer], [compile without GStreamer audio support])],
enable_gst="$enableval", enable_gst="yes")
@@ -847,10 +844,6 @@ if test "x$enable_gst" != "xno"; then
AC_DEFINE(USE_GSTREAMER, 1, [Use GStreamer for playing sounds])
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
- AC_CHECK_LIB(gstreamer-0.10, gst_registry_fork_set_enabled,
- [ AC_DEFINE(GST_CAN_DISABLE_FORKING, [],
- [Define if gst_registry_fork_set_enabled exists])],
- [], [$GSTREAMER_LIBS])
], [
AC_MSG_RESULT(no)
enable_gst="no"
@@ -911,7 +904,7 @@ AC_ARG_ENABLE(vv,
[AC_HELP_STRING([--disable-vv], [compile without voice and video support])],
enable_vv="$enableval", enable_vv="yes")
if test "x$enable_vv" != "xno"; then
- if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno"; then
+ if test "x$enable_gst" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno"; then
AC_DEFINE(USE_VV, 1, [Use voice and video])
else
enable_vv="no"
@@ -924,7 +917,7 @@ Or use --disable-vv if you do not need v
fi
fi
fi
-AM_CONDITIONAL(USE_VV, test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farstream" != "xno")
+AM_CONDITIONAL(USE_VV, test "x$enable_vv" != "xno")
dnl #######################################################################
dnl # Check for Internationalized Domain Name support
diff --git a/finch/gntsound.c b/finch/gntsound.c
--- a/finch/gntsound.c
+++ b/finch/gntsound.c
@@ -553,7 +553,7 @@ finch_sound_play_file(const char *filena
return;
}
- play = gst_element_factory_make("playbin", "play");
+ play = gst_element_factory_make("playbin2", "play");
if (play == NULL) {
return;
diff --git a/libpurple/dnsquery.c b/libpurple/dnsquery.c
--- a/libpurple/dnsquery.c
+++ b/libpurple/dnsquery.c
@@ -80,8 +80,7 @@ struct _PurpleDnsQueryResolverProcess {
};
static GSList *free_dns_children = NULL;
-/* TODO: Make me a GQueue when we require >= glib 2.4 */
-static GSList *queued_requests = NULL;
+static GQueue *queued_requests = NULL;
static int number_of_dns_children = 0;
@@ -581,12 +580,11 @@ handle_next_queued_request(void)
PurpleDnsQueryData *query_data;
PurpleDnsQueryResolverProcess *resolver;
- if (queued_requests == NULL)
+ if (g_queue_is_empty(queued_requests))
/* No more DNS queries, yay! */
return;
- query_data = queued_requests->data;
- queued_requests = g_slist_delete_link(queued_requests, queued_requests);
+ query_data = g_queue_pop_head(queued_requests);
/*
* If we have any children, attempt to have them perform the DNS
@@ -610,7 +608,7 @@ handle_next_queued_request(void)
if (number_of_dns_children >= MAX_DNS_CHILDREN)
{
/* Apparently all our children are busy */
- queued_requests = g_slist_prepend(queued_requests, query_data);
+ g_queue_push_tail(queued_requests, query_data);
return;
}
@@ -696,7 +694,7 @@ host_resolved(gpointer data, gint source
static void
resolve_host(PurpleDnsQueryData *query_data)
{
- queued_requests = g_slist_append(queued_requests, query_data);
+ g_queue_push_tail(queued_requests, query_data);
handle_next_queued_request();
}
@@ -953,7 +951,7 @@ purple_dnsquery_destroy(PurpleDnsQueryDa
ops->destroy(query_data);
#if defined(PURPLE_DNSQUERY_USE_FORK)
- queued_requests = g_slist_remove(queued_requests, query_data);
+ g_queue_remove(queued_requests, query_data);
if (query_data->resolver != NULL)
/*
@@ -1030,6 +1028,9 @@ purple_dnsquery_get_ui_ops(void)
void
purple_dnsquery_init(void)
{
+#if defined(PURPLE_DNSQUERY_USE_FORK)
+ queued_requests = g_queue_new();
+#endif
}
void
@@ -1041,5 +1042,9 @@ purple_dnsquery_uninit(void)
purple_dnsquery_resolver_destroy(free_dns_children->data);
free_dns_children = g_slist_remove(free_dns_children, free_dns_children->data);
}
+
+ g_queue_free(queued_requests);
+ queued_requests = NULL;
#endif /* end PURPLE_DNSQUERY_USE_FORK */
}
+
diff --git a/libpurple/tests/test_util.c b/libpurple/tests/test_util.c
--- a/libpurple/tests/test_util.c
+++ b/libpurple/tests/test_util.c
@@ -167,14 +167,179 @@ START_TEST(test_markup_html_to_xhtml)
{
gchar *xhtml = NULL;
gchar *plaintext = NULL;
+
purple_markup_html_to_xhtml("<a>", &xhtml, &plaintext);
assert_string_equal_free("<a href=\"\"></a>", xhtml);
assert_string_equal_free("", plaintext);
+ purple_markup_html_to_xhtml("<A href='URL'>ABOUT</a>", &xhtml, &plaintext);
+ assert_string_equal_free("<a href=\"URL\">ABOUT</a>", xhtml);
+ assert_string_equal_free("ABOUT <URL>", plaintext);
+
+ purple_markup_html_to_xhtml("<a href='URL'>URL</a>", &xhtml, &plaintext);
+ assert_string_equal_free("URL", plaintext);
+ assert_string_equal_free("<a href=\"URL\">URL</a>", xhtml);
+
+ purple_markup_html_to_xhtml("<a href='mailto:mail'>mail</a>", &xhtml, &plaintext);
+ assert_string_equal_free("mail", plaintext);
+ assert_string_equal_free("<a href=\"mailto:mail\">mail</a>", xhtml);
+
+ purple_markup_html_to_xhtml("<A href='\"U'R&L'>ABOUT</a>", &xhtml, &plaintext);
+ assert_string_equal_free("<a href=\""U'R&L\">ABOUT</a>", xhtml);
+ assert_string_equal_free("ABOUT <\"U'R&L>", plaintext);
+
+ purple_markup_html_to_xhtml("<img src='SRC' alt='ALT'/>", &xhtml, &plaintext);
+ assert_string_equal_free("<img src='SRC' alt='ALT' />", xhtml);
+ assert_string_equal_free("ALT", plaintext);
+
+ purple_markup_html_to_xhtml("<img src=\"'S'R&C\" alt=\"'A'L&T\"/>", &xhtml, &plaintext);
+ assert_string_equal_free("<img src=''S'R&C' alt=''A'L&T' />", xhtml);
+ assert_string_equal_free("'A'L&T", plaintext);
+
+ purple_markup_html_to_xhtml("<unknown>", &xhtml, &plaintext);
+ assert_string_equal_free("<unknown>", xhtml);
+ assert_string_equal_free("<unknown>", plaintext);
+
+ purple_markup_html_to_xhtml("é&", &xhtml, &plaintext);
+ assert_string_equal_free("é&", xhtml);
+ assert_string_equal_free("é&", plaintext);
+
+ purple_markup_html_to_xhtml("<h1>A<h2>B</h2>C</h1>", &xhtml, &plaintext);
+ assert_string_equal_free("<h1>A<h2>B</h2>C</h1>", xhtml);
+ assert_string_equal_free("ABC", plaintext);
+
+ purple_markup_html_to_xhtml("<h1><h2><h3><h4>", &xhtml, &plaintext);
+ assert_string_equal_free("<h1><h2><h3><h4></h4></h3></h2></h1>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<italic/>", &xhtml, &plaintext);
+ assert_string_equal_free("<em/>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("</", &xhtml, &plaintext);
+ assert_string_equal_free("</", xhtml);
+ assert_string_equal_free("</", plaintext);
+
+ purple_markup_html_to_xhtml("</div>", &xhtml, &plaintext);
+ assert_string_equal_free("", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<hr/>", &xhtml, &plaintext);
+ assert_string_equal_free("<br/>", xhtml);
+ assert_string_equal_free("\n", plaintext);
+
+ purple_markup_html_to_xhtml("<hr>", &xhtml, &plaintext);
+ assert_string_equal_free("<br/>", xhtml);
+ assert_string_equal_free("\n", plaintext);
+
+ purple_markup_html_to_xhtml("<br />", &xhtml, &plaintext);
+ assert_string_equal_free("<br/>", xhtml);
+ assert_string_equal_free("\n", plaintext);
+
+ purple_markup_html_to_xhtml("<br>INSIDE</br>", &xhtml, &plaintext);
+ assert_string_equal_free("<br/>INSIDE", xhtml);
+ assert_string_equal_free("\nINSIDE", plaintext);
+
+ purple_markup_html_to_xhtml("<div></div>", &xhtml, &plaintext);
+ assert_string_equal_free("<div></div>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<div/>", &xhtml, &plaintext);
+ assert_string_equal_free("<div/>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<div attr='\"&<>'/>", &xhtml, &plaintext);
+ assert_string_equal_free("<div attr='"&<>'/>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<div attr=\"'\"/>", &xhtml, &plaintext);
+ assert_string_equal_free("<div attr=\"'\"/>", xhtml);
+ assert_string_equal_free("", plaintext);
+
+ purple_markup_html_to_xhtml("<div/> < <div/>", &xhtml, &plaintext);
+ assert_string_equal_free("<div/> < <div/>", xhtml);
+ assert_string_equal_free(" < ", plaintext);
+
+ purple_markup_html_to_xhtml("<div>x</div>", &xhtml, &plaintext);
+ assert_string_equal_free("<div>x</div>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<b>x</b>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='font-weight: bold;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<bold>x</bold>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='font-weight: bold;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<strong>x</strong>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='font-weight: bold;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<u>x</u>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='text-decoration: underline;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<underline>x</underline>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='text-decoration: underline;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<s>x</s>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='text-decoration: line-through;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<strike>x</strike>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='text-decoration: line-through;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<sub>x</sub>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='vertical-align:sub;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<sup>x</sup>", &xhtml, &plaintext);
+ assert_string_equal_free("<span style='vertical-align:super;'>x</span>", xhtml);
+ assert_string_equal_free("x", plaintext);
purple_markup_html_to_xhtml("<FONT>x</FONT>", &xhtml, &plaintext);
assert_string_equal_free("x", xhtml);
assert_string_equal_free("x", plaintext);
+
+ purple_markup_html_to_xhtml("<font face=\"'Times>New & Roman'\">x</font>", &xhtml, &plaintext);
+ assert_string_equal_free("x", plaintext);
+ assert_string_equal_free("<span style='font-family: \"Times>New & Roman\";'>x</span>", xhtml);
+
+ purple_markup_html_to_xhtml("<font back=\"'color>blue&red'\">x</font>", &xhtml, &plaintext);
+ assert_string_equal_free("x", plaintext);
+ assert_string_equal_free("<span style='background: \"color>blue&red\";'>x</span>", xhtml);
+
+ purple_markup_html_to_xhtml("<font color=\"'color>blue&red'\">x</font>", &xhtml, &plaintext);
+ assert_string_equal_free("x", plaintext);
+ assert_string_equal_free("<span style='color: \"color>blue&red\";'>x</span>", xhtml);
+
+ purple_markup_html_to_xhtml("<font size=1>x</font>", &xhtml, &plaintext);
+ assert_string_equal_free("x", plaintext);
+ assert_string_equal_free("<span style='font-size: xx-small;'>x</span>", xhtml);
+
+ purple_markup_html_to_xhtml("<font size=432>x</font>", &xhtml, &plaintext);
+ assert_string_equal_free("x", plaintext);
+ assert_string_equal_free("<span style='font-size: medium;'>x</span>", xhtml);
+
+ /* The following tests document a behaviour that looks suspicious */
+
+ /* bug report http://developer.pidgin.im/ticket/13485 */
+ purple_markup_html_to_xhtml("<!--COMMENT-->", &xhtml, &plaintext);
+ assert_string_equal_free("<!--COMMENT-->", xhtml);
+ assert_string_equal_free("COMMENT-->", plaintext);
+
More information about the Commits
mailing list