summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tab-chrome.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index ed47dd6..8f36cb4 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -768,28 +768,17 @@ mq_tab_chrome_get_container(MqTabChrome *chrome)
return chrome->container;
}
-static gchar *
+const gchar *
web_view_get_uri(MqWebView *web_view)
{
- const gchar *uri;
- gchar *rw_uri;
-
- uri = mq_web_view_get_uri(web_view);
-
- if (g_str_has_prefix(uri, "mq-about:")) {
- rw_uri = g_strconcat("about:", uri + strlen("mq-about:"), NULL);
- } else {
- rw_uri = g_strdup(uri);
- }
-
- return rw_uri;
+ return mq_web_view_get_uri(web_view);
}
static void
load_changed_cb(MqWebView *web_view, WebKitLoadEvent load_event,
MqTabChrome *chrome)
{
- gchar *uri;
+ const gchar *uri;
switch (load_event) {
case WEBKIT_LOAD_STARTED:
@@ -797,7 +786,6 @@ load_changed_cb(MqWebView *web_view, WebKitLoadEvent load_event,
case WEBKIT_LOAD_COMMITTED:
uri = web_view_get_uri(web_view);
gtk_entry_set_text(GTK_ENTRY(chrome->uri_entry), uri);
- g_free(uri);
gtk_entry_set_attributes(GTK_ENTRY(chrome->uri_entry),
NULL);
break;
@@ -825,7 +813,7 @@ mouse_target_changed_cb(MqWebView G_GNUC_UNUSED *web_view,
WebKitHitTestResult *hit_test_result, guint G_GNUC_UNUSED modifiers,
MqTabChrome *chrome)
{
- gchar *uri;
+ const gchar *uri;
uri = web_view_get_uri(web_view);
if (webkit_hit_test_result_context_is_link(hit_test_result)) {
@@ -875,8 +863,6 @@ mouse_target_changed_cb(MqWebView G_GNUC_UNUSED *web_view,
NULL);
}
}
-
- g_free(uri);
}
static void
@@ -902,11 +888,10 @@ static void
uri_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *paramspec,
MqTabChrome *chrome)
{
- gchar *uri;
+ const gchar *uri;
uri = web_view_get_uri(web_view);
gtk_entry_set_text(GTK_ENTRY(chrome->uri_entry), uri);
- g_free(uri);
gtk_entry_set_attributes(GTK_ENTRY(chrome->uri_entry), NULL);
}