diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-30 15:56:11 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-30 15:56:11 (EDT) |
commit | 1cd10f5657467684349c16216fa8e22efed7deca (patch) | |
tree | 12b1734682a9a519869000faeb7fc644be866e98 | |
parent | 504ab61864a067cde3fe471cc28eff5025b0c0b8 (diff) | |
download | marquee-1cd10f5657467684349c16216fa8e22efed7deca.zip marquee-1cd10f5657467684349c16216fa8e22efed7deca.tar.gz marquee-1cd10f5657467684349c16216fa8e22efed7deca.tar.bz2 |
MqWebView: Handle NULL URI in constructed()
-rw-r--r-- | src/web-view.c | 14 |
1 files changed, 14 insertions, 0 deletions
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); |