diff options
-rw-r--r-- | src/web-view.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/web-view.c b/src/web-view.c index c3ffbca..941e6f2 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -28,11 +28,13 @@ #include "web-view.h" #include "tab.h" +#include "config.h" struct _MqWebView { WebKitWebView parent_instance; MqTab *tab; gchar *uri; + MqConfig *config; WebKitHitTestResult *hit_test_result; WebKitHitTestResult *mouse_target_hit_test_result; }; @@ -546,7 +548,6 @@ constructed(GObject *object) { MqWebView *web_view; gchar *rw_uri; - MqConfig *config; gchar *new_tab_page; if (G_OBJECT_CLASS(mq_web_view_parent_class)->constructed) { @@ -555,6 +556,9 @@ constructed(GObject *object) web_view = MQ_WEB_VIEW(object); + web_view->config = mq_application_get_config( + mq_tab_get_application(web_view->tab)); + webkit_web_view_set_settings(WEBKIT_WEB_VIEW(web_view), mq_application_get_webkit_settings( mq_tab_get_application(web_view->tab))); @@ -571,12 +575,12 @@ constructed(GObject *object) web_view->uri); } } else { - config = mq_application_get_config( - mq_tab_get_application(web_view->tab)); - new_tab_page = mq_config_get_string(config, "tabs.new"); + new_tab_page = mq_config_get_string(web_view->config, + "tabs.new"); if (g_strcmp0(new_tab_page, "home") == 0) { webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), - mq_config_get_string(config, "tabs.home")); + mq_config_get_string(web_view->config, + "tabs.home")); } else if (g_strcmp0(new_tab_page, "blank") == 0) { /* Don't load any URI. */ } else { @@ -585,10 +589,7 @@ constructed(GObject *object) } webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view), - mq_config_get_double( - mq_application_get_config( - mq_tab_get_application(web_view->tab)), - "zoom.default")); + mq_config_get_double(web_view->config, "zoom.default")); gtk_widget_set_vexpand(GTK_WIDGET(web_view), TRUE); /* FIXME: This doesn't seem to be working. */ |