summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-06 19:18:22 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-06 19:18:22 (EDT)
commit25125da0242cf3a55999f3101418a572a5e97c5f (patch)
tree9398bf5d4e43efef0b7a968c2bdd6fa238adfb30 /src
parent8c4972f379e07e0f3ac4fa6885c011fdada0c128 (diff)
downloadmarquee-25125da0242cf3a55999f3101418a572a5e97c5f.zip
marquee-25125da0242cf3a55999f3101418a572a5e97c5f.tar.gz
marquee-25125da0242cf3a55999f3101418a572a5e97c5f.tar.bz2
mq_tab_body_new(): Load home page if configured to do so
Also fix variable declaration alignment.
Diffstat (limited to 'src')
-rw-r--r--src/tab-body.c15
1 files changed, 14 insertions, 1 deletions
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);