From 1cd10f5657467684349c16216fa8e22efed7deca Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 30 Oct 2017 15:56:11 -0400 Subject: MqWebView: Handle NULL URI in constructed() --- (limited to 'src') diff --git a/src/web-view.c b/src/web-view.c index 9152c27..bf8a256 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -198,6 +198,7 @@ static void constructed(GObject *object) { MqWebView *web_view; + gchar *new_tab_page; if (G_OBJECT_CLASS(mq_web_view_parent_class)->constructed) { G_OBJECT_CLASS(mq_web_view_parent_class)->constructed(object); @@ -212,6 +213,19 @@ constructed(GObject *object) mq_application_get_webkit_settings( mq_tab_page_get_application(web_view->tab_page))); + if (!web_view->uri) { + new_tab_page = mq_config_get_string(web_view->config, + "tabs.new"); + if (g_strcmp0(new_tab_page, "home") == 0) { + web_view->uri = mq_config_get_string(web_view->config, + "tabs.home"); + } else if (g_strcmp0(new_tab_page, "blank") == 0) { + /* Don't load any URI. */ + } else { + g_assert_not_reached(); + } + } + mq_web_view_scheme_set_methods(&web_view->scheme_methods, &web_view->scheme, web_view->uri); -- cgit v0.9.1