1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00

download_dialog_layouter(): store bittorrent test result in a temporary

variable.
This commit is contained in:
Laurent MONIN 2005-09-19 16:02:27 +02:00 committed by Laurent MONIN
parent 5455795394
commit 787059253c

View File

@ -131,6 +131,10 @@ download_dialog_layouter(struct dialog_data *dlg_data)
unsigned char *msg = get_download_msg(download, term, 1, 1, "\n");
int show_meter = (download_is_progressing(download)
&& download->progress->size >= 0);
#if CONFIG_BITTORRENT
int bittorrent = (file_download->uri->protocol == PROTOCOL_BITTORRENT
&& (show_meter || download->state == S_RESUME));
#endif
redraw_below_window(dlg_data->win);
file_download->dlg_data = dlg_data;
@ -156,9 +160,7 @@ download_dialog_layouter(struct dialog_data *dlg_data)
if (show_meter) y += 2;
#if CONFIG_BITTORRENT
if (file_download->uri->protocol == PROTOCOL_BITTORRENT
&& (show_meter || download->state == S_RESUME))
y += 2;
if (bittorrent) y += 2;
#endif
dlg_format_text_do(NULL, msg, 0, &y, w, &rw,
dialog_text_color, ALIGN_LEFT);
@ -194,8 +196,7 @@ download_dialog_layouter(struct dialog_data *dlg_data)
}
#if CONFIG_BITTORRENT
if (file_download->uri->protocol == PROTOCOL_BITTORRENT
&& (show_meter || download->state == S_RESUME)) {
if (bittorrent) {
y++;
draw_bittorrent_piece_progress(download, term, x, y, w, NULL, NULL);
y++;