summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-12 02:12:10 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-12 02:12:10 (EDT)
commit7269e5e9d8c1206b634ce2a65fca54b8e6a71631 (patch)
treea254802327677f43abac20e738265908df67f385
parent9de2cf3afa36bb81e649ae63f27d019b96f9d763 (diff)
downloadmarquee-7269e5e9d8c1206b634ce2a65fca54b8e6a71631.zip
marquee-7269e5e9d8c1206b634ce2a65fca54b8e6a71631.tar.gz
marquee-7269e5e9d8c1206b634ce2a65fca54b8e6a71631.tar.bz2
MqWebView: Drop last URI rewriting code
-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);
}