From 787059253c16a27fe6027bf5a1948aa798db2482 Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Mon, 19 Sep 2005 16:02:27 +0200 Subject: [PATCH] download_dialog_layouter(): store bittorrent test result in a temporary variable. --- src/dialogs/download.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dialogs/download.c b/src/dialogs/download.c index 532cc19f..d0d634e8 100644 --- a/src/dialogs/download.c +++ b/src/dialogs/download.c @@ -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++;