aboutsummaryrefslogtreecommitdiff
path: root/src/history.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-01-27 18:30:24 -0300
committerJorge Arellano Cid <jcid@dillo.org>2009-01-27 18:30:24 -0300
commitd43791f8cf6334d3dcd70b8d569044e357d7c33c (patch)
treee13a314fb353bc0d75fcc0e3af5dd25fce321e99 /src/history.c
parent8d23bb6e0bf9bc32d9be7f92df4abdb68e3a7c70 (diff)
Implemented the tools button with CSS options. Also removed nav.h from html.cc
Diffstat (limited to 'src/history.c')
-rw-r--r--src/history.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/history.c b/src/history.c
index 4b8fb426..626c3015 100644
--- a/src/history.c
+++ b/src/history.c
@@ -75,19 +75,6 @@ int a_History_add_url(DilloUrl *url)
}
/*
- * Set the page-title for a given URL (by idx)
- * (this is known when the first chunks of HTML data arrive)
- */
-int a_History_set_title(int idx, const char *title)
-{
- dReturn_val_if_fail(idx >= 0 && idx < history_size, 0);
-
- dFree(history[idx].title);
- history[idx].title = dStrdup(title);
- return 1;
-}
-
-/*
* Return the DilloUrl field (by index)
*/
DilloUrl *a_History_get_url(int idx)
@@ -137,6 +124,27 @@ const char *a_History_get_title_by_url(const DilloUrl *url, int force)
return NULL;
}
+/*
+ * Set the page-title for a given URL
+ */
+void a_History_set_title_by_url(const DilloUrl *url, const char *title)
+{
+ int i;
+
+ dReturn_if (url == NULL);
+
+ for (i = history_size - 1; i >= 0; --i)
+ if (a_Url_cmp(url, history[i].url) == 0)
+ break;
+
+ if (i >= 0) {
+ dFree(history[i].title);
+ history[i].title = dStrdup(title);
+ } else {
+ MSG_ERR("a_History_set_title_by_url: %s not found\n", URL_STR(url));
+ }
+}
+
/*
* Free all the memory used by this module