summaryrefslogtreecommitdiff
path: root/src/html.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-06-27 01:41:37 +0200
committerportix <portix@gmx.net>2011-06-27 01:41:37 +0200
commitbab8a9c83e4f8674671c5c3a11225026294d2bf2 (patch)
treec5d4c0a241d1c7de3a82c367f3624c2ffc906b88 /src/html.c
parent32c0920ad002d76ea4b41e0425ad4bc8781f7924 (diff)
downloaddwb-bab8a9c83e4f8674671c5c3a11225026294d2bf2.zip
Load anchored setting uris
Diffstat (limited to 'src/html.c')
-rw-r--r--src/html.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/html.c b/src/html.c
index cebcee7a..8a1150ed 100644
--- a/src/html.c
+++ b/src/html.c
@@ -31,6 +31,7 @@ static HtmlTable table[] = {
{ "dwb://settings", "Settings", INFO_FILE, 0, dwb_html_settings },
};
+static char current_uri[BUFFER_LENGTH];
void
dwb_html_load_page(WebKitWebView *wv, HtmlTable *t, char *panel) {
char *filecontent;
@@ -48,7 +49,7 @@ dwb_html_load_page(WebKitWebView *wv, HtmlTable *t, char *panel) {
g_file_get_contents(path, &filecontent, NULL, NULL);
if (panel)
g_string_append_printf(content, filecontent, panel);
- webkit_web_frame_load_alternate_string(webkit_web_view_get_main_frame(wv), content->str, t->uri, t->uri);
+ webkit_web_frame_load_alternate_string(webkit_web_view_get_main_frame(wv), content->str, current_uri, current_uri);
g_string_free(content, true);
g_free(filecontent);
FREE(path);
@@ -185,7 +186,8 @@ dwb_html_quickmarks(WebKitWebView *wv, HtmlTable *table) {
gboolean
dwb_html_load(WebKitWebView *wv, const char *uri) {
for (int i=0; i<LENGTH(table); i++) {
- if (!strcmp(table[i].uri, uri)) {
+ if (!strncmp(table[i].uri, uri, strlen(table[i].uri))) {
+ strncpy(current_uri, uri, BUFFER_LENGTH - 1);
table[i].func(wv, &table[i]);
return true;
}