changeset 1661:0c5d982c92a0

Add const qualifier to a_History_get_url()
author Jorge Arellano Cid <jcid@dillo.org>
date Fri, 23 Apr 2010 12:15:55 -0400
parents 0cf0c7e0064c
children 53307b7407e1
files src/history.c src/history.h src/menu.cc src/nav.c src/uicmd.cc
diffstat 5 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/history.c	Thu Apr 22 02:21:38 2010 +0000
+++ b/src/history.c	Fri Apr 23 12:15:55 2010 -0400
@@ -77,7 +77,7 @@
 /*
  * Return the DilloUrl field (by index)
  */
-DilloUrl *a_History_get_url(int idx)
+const DilloUrl *a_History_get_url(int idx)
 {
    _MSG("a_History_get_url: ");
    /* History_show(); */
--- a/src/history.h	Thu Apr 22 02:21:38 2010 +0000
+++ b/src/history.h	Fri Apr 23 12:15:55 2010 -0400
@@ -11,7 +11,7 @@
 
 int a_History_add_url(DilloUrl *url);
 void a_History_set_title_by_url(const DilloUrl *url, const char *title);
-DilloUrl *a_History_get_url(int idx);
+const DilloUrl *a_History_get_url(int idx);
 const char *a_History_get_title(int idx, int force);
 const char *a_History_get_title_by_url(const DilloUrl *url, int force);
 void a_History_freeall(void);
--- a/src/menu.cc	Thu Apr 22 02:21:38 2010 +0000
+++ b/src/menu.cc	Fri Apr 23 12:15:55 2010 -0400
@@ -67,7 +67,7 @@
  * TODO: erase the URL on popup close.
  */
 void CustItem::draw() {
-   DilloUrl *url;
+   const DilloUrl *url;
 
    if (flags() & SELECTED) {
       url = a_History_get_url(history_list[(VOIDP2INT(user_data()))-1]);
@@ -287,7 +287,7 @@
 {
    int mb = ((CustItem*)wid)->button();
    int offset = history_direction * VOIDP2INT(data);
-   DilloUrl *url = a_History_get_url(history_list[VOIDP2INT(data)-1]);
+   const DilloUrl *url = a_History_get_url(history_list[VOIDP2INT(data)-1]);
 
    if (mb == 2) {
       // Middle button, open in a new window/tab
--- a/src/nav.c	Thu Apr 22 02:21:38 2010 +0000
+++ b/src/nav.c	Fri Apr 23 12:15:55 2010 -0400
@@ -194,7 +194,7 @@
 static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url,
                          const DilloUrl *requester, int offset)
 {
-   DilloUrl *old_url;
+   const DilloUrl *old_url;
    bool_t MustLoad, ForceReload, Repush, IgnoreScroll;
    int x, y, idx, ClientKey;
    DilloWeb *Web;
@@ -319,7 +319,7 @@
    }
 
    if (goto_old_scroll) {
-      /* Scroll to were we were in this page */
+      /* Scroll to where we were in this page */
       Nav_get_scroll_pos(bw, &posx, &posy);
       a_UIcmd_set_scroll_xy(bw, posx, posy);
       _MSG("Nav: expect_done scrolling to x=%d y=%d\n", posx, posy);
@@ -475,7 +475,8 @@
 static void Nav_reload_callback(void *data)
 {
    BrowserWindow *bw = data;
-   DilloUrl *h_url, *r_url;
+   const DilloUrl *h_url;
+   DilloUrl *r_url;
    int choice, confirmed = 1;
 
    a_Nav_cancel_expect(bw);
--- a/src/uicmd.cc	Thu Apr 22 02:21:38 2010 +0000
+++ b/src/uicmd.cc	Fri Apr 23 12:15:55 2010 -0400
@@ -948,7 +948,7 @@
 void a_UIcmd_page_popup(void *vbw, bool_t has_bugs, void *v_cssUrls)
 {
    BrowserWindow *bw = (BrowserWindow*)vbw;
-   DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
+   const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
    a_Menu_page_popup(bw, url, has_bugs, v_cssUrls);
 }