aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-04-09 09:49:33 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-04-09 10:18:07 +0800
commiteb6ecc6fb5d1b6859fab949ba20865d2ca784306 (patch)
tree84fa579ba12487f2f62e6229c94e35d5e6080a21 /e-util
parent721fef2d96464dde0155cc98e7e98b7cc936ad5c (diff)
downloadgsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar.gz
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar.bz2
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar.lz
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar.xz
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.tar.zst
gsoc2013-evolution-eb6ecc6fb5d1b6859fab949ba20865d2ca784306.zip
EWebView: Disable WebKit plugins during instance initialization.
Calling webkit_get_web_plugin_database() somehow ends up calling g_bus_get_sync(), which in turn makes gtkdoc-scangobj hang forever. Call it instead as a GOnce callback during instance initialization, which avoids the hang since gtkdoc-scangobj only peeks at classes.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-web-view.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index 32c37e026d..4f52b9585f 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -101,6 +101,7 @@ enum {
};
static guint signals[LAST_SIGNAL];
+static GOnce disable_webkit_3rd_party_plugins_once = G_ONCE_INIT;
static const gchar *ui =
"<ui>"
@@ -1451,8 +1452,8 @@ web_view_drag_motion (GtkWidget *widget,
return FALSE;
}
-static void
-web_view_disable_webkit_3rd_party_plugins (void)
+static gpointer
+web_view_disable_webkit_3rd_party_plugins (gpointer unused)
{
WebKitWebPluginDatabase *database;
GSList *installed_plugins, *iterator;
@@ -1460,17 +1461,19 @@ web_view_disable_webkit_3rd_party_plugins (void)
database = webkit_get_web_plugin_database ();
if (!database)
- return;
+ return NULL;
installed_plugins = webkit_web_plugin_database_get_plugins (database);
if (!installed_plugins)
- return;
+ return NULL;
for (iterator = installed_plugins; iterator; iterator = iterator->next)
webkit_web_plugin_set_enabled (iterator->data, FALSE);
webkit_web_plugin_database_plugins_list_free (installed_plugins);
+
+ return NULL;
}
static void
@@ -1678,8 +1681,6 @@ e_web_view_class_init (EWebViewClass *class)
e_marshal_BOOLEAN__STRING,
G_TYPE_BOOLEAN, 1, G_TYPE_STRING);
- web_view_disable_webkit_3rd_party_plugins ();
-
webkit_set_cache_model (WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER);
webkit_set_default_web_database_quota (0);
webkit_application_cache_set_maximum_size (0);
@@ -1714,6 +1715,10 @@ e_web_view_init (EWebView *web_view)
const gchar *id;
GError *error = NULL;
+ g_once (
+ &disable_webkit_3rd_party_plugins_once,
+ web_view_disable_webkit_3rd_party_plugins, NULL);
+
web_view->priv = E_WEB_VIEW_GET_PRIVATE (web_view);
g_signal_connect (