From 25125da0242cf3a55999f3101418a572a5e97c5f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 06 Oct 2017 19:18:22 -0400 Subject: mq_tab_body_new(): Load home page if configured to do so Also fix variable declaration alignment. --- (limited to 'src') diff --git a/src/tab-body.c b/src/tab-body.c index 54bbd17..85f7e45 100644 --- a/src/tab-body.c +++ b/src/tab-body.c @@ -479,7 +479,9 @@ MqTabBody * mq_tab_body_new(MqTab *tab, const gchar *uri) { MqTabBody *body; - gchar *rw_uri; + gchar *rw_uri; + MqConfig *config; + gchar *new_tab_page; body = malloc(sizeof(*body)); body->tab = tab; @@ -497,6 +499,17 @@ mq_tab_body_new(MqTab *tab, const gchar *uri) } else { webkit_web_view_load_uri(body->web_view, uri); } + } else { + config = mq_application_get_config(mq_tab_get_application(tab)); + new_tab_page = mq_config_get_string(config, "tabs.new"); + if (g_strcmp0(new_tab_page, "home") == 0) { + webkit_web_view_load_uri(body->web_view, + mq_config_get_string(config, "tabs.home")); + } else if (g_strcmp0(new_tab_page, "blank") == 0) { + /* Don't load any URI. */ + } else { + g_assert_not_reached(); + } } body->container = GTK_WIDGET(body->web_view); -- cgit v0.9.1