diff options
Diffstat (limited to 'src/tab-label.c')
-rw-r--r-- | src/tab-label.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index 72443b9..82f5fa1 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -189,6 +189,17 @@ update_label(MqTabLabel *tab_label) } static void +set_title(MqTabLabel *tab_label, const gchar *title) +{ + g_free(tab_label->title); + tab_label->title = g_strdup(title); + if (tab_label->scrolling) { + tab_label->scrolled_title = g_strdup_printf("%s ", title); + } + update_label(tab_label); +} + +static void favicon_cb(WebKitWebView G_GNUC_UNUSED *web_view, GParamSpec G_GNUC_UNUSED *param_spec, MqTabLabel *tab_label) { @@ -216,12 +227,7 @@ static void title_cb(WebKitWebView G_GNUC_UNUSED *web_view, GParamSpec G_GNUC_UNUSED *param_spec, MqTabLabel *tab_label) { - tab_label->title = webkit_web_view_get_title(tab_label->web_view); - if (tab_label->scrolling) { - tab_label->scrolled_title = g_strdup_printf("%s ", - tab_label->title); - } - update_label(tab_label); + set_title(tab_label, webkit_web_view_get_title(tab_label->web_view)); } static void |