1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Add documents displayed via "What to do" dialog to globhist

First the patch makes sure doc_loading_callback is always called from
tp_display even if the download is in result state. This is often the
case for local files that the user decides to display via the WTD dialog.

Furthermore, improve the adding to globhist part of doc_loading_callback,
so that it works also for downloads in result state where the
download->conn member is NULL. In addition to grabbing the URI from the
connection try also the cache entry if it is set.

Fixes: bug 355 (Documents displayed via WTD aren't added to globhist)
This commit is contained in:
Jonas Fonseca 2006-02-07 02:25:27 +01:00 committed by Jonas Fonseca
parent 0d53158553
commit 03299d6c2e
2 changed files with 12 additions and 7 deletions

View File

@ -967,10 +967,7 @@ tp_display(struct type_query *type_query)
new->callback = (download_callback_T *) doc_loading_callback;
new->data = ses;
if (is_in_progress_state(old->state))
move_download(old, new, PRI_MAIN);
else
new->state = old->state;
move_download(old, new, PRI_MAIN);
}
display_timer(ses);

View File

@ -604,11 +604,19 @@ doc_loading_callback(struct download *download, struct session *ses)
print_screen_status(ses);
#ifdef CONFIG_GLOBHIST
if (download->conn && download->pri != PRI_CSS) {
if (download->pri != PRI_CSS) {
unsigned char *title = ses->doc_view->document->title;
struct uri *uri = download->conn->proxied_uri;
struct uri *uri;
add_global_history_item(struri(uri), title, time(NULL));
if (download->conn)
uri = download->conn->proxied_uri;
else if (download->cached)
uri = download->cached->uri;
else
uri = NULL;
if (uri)
add_global_history_item(struri(uri), title, time(NULL));
}
#endif