From 7063a2871097bd62140655a2a0cc8f4e300db4c4 Mon Sep 17 00:00:00 2001 From: Kerrick Staley Date: Mon, 4 Nov 2013 11:10:12 -0500 Subject: Bug 707112 - Replace webkit_dom_html_element_get_id usage webkit_dom_element_get_id() was introduced for WebKitGTK+ 2.2 and deprecates webkit_dom_html_element_get_id(). But Evolution only requires WebKitGTK+ 2.0.1. Ordinarily this would sit on a shelf until we require WebKitGTK+ 2.2, however WebKitGTK+ has now started issuing deprecation warnings about webkit_dom_html_element_get_id() at *runtime*, which is pointless and only fills up users' .xsession-errors file. To put a stop to this, we'll call the new function subject to a pre- processor WebKit version check, with a fallback to the old function. The build requirement remains at WebKitGTK+ 2.0.1. --- modules/itip-formatter/itip-view.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index 45f0b1d393..769b45ac2c 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -796,7 +796,15 @@ alarm_check_toggled_cb (WebKitDOMHTMLInputElement *check1, ItipView *view) { WebKitDOMElement *check2; - gchar *id = webkit_dom_html_element_get_id (WEBKIT_DOM_HTML_ELEMENT (check1)); + gchar *id; + +#if WEBKIT_CHECK_VERSION(2,2,0) /* XXX should really be (2,1,something) */ + id = webkit_dom_element_get_id ( + WEBKIT_DOM_ELEMENT (check1)); +#else + id = webkit_dom_html_element_get_id ( + WEBKIT_DOM_HTML_ELEMENT (check1)); +#endif if (g_strcmp0 (id, CHECKBOX_INHERIT_ALARM)) { check2 = webkit_dom_document_get_element_by_id ( @@ -905,7 +913,11 @@ append_info_item_row (ItipView *view, WEBKIT_DOM_HTML_TABLE_ELEMENT (table), -1, NULL); id = g_strdup_printf ("%s_row_%d", table_id, item->id); +#if WEBKIT_CHECK_VERSION(2,2,0) /* XXX should really be (2,1,something) */ + webkit_dom_element_set_id (WEBKIT_DOM_ELEMENT(row), id); +#else webkit_dom_html_element_set_id (row, id); +#endif g_free (id); switch (item->type) { -- cgit v1.2.3