From 48adf2dcf9cd68f5876c101b728f87f0aaff1893 Mon Sep 17 00:00:00 2001 From: Thorsten Maerz Date: Thu, 13 Feb 2003 19:05:55 +0000 Subject: [PATCH] revert news progressbar (GUI separation) --- ChangeLog.claws | 5 ++++ configure.ac | 2 +- src/news.c | 68 +++++-------------------------------------------- 3 files changed, 12 insertions(+), 63 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 97613e98b..fd90378f9 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2003-02-13 [thorsten] 0.8.10claws9 + + * src/news.c + revert news progressbar (GUI separation) + 2003-02-13 [paul] 0.8.10claws8 * src/compose.c diff --git a/configure.ac b/configure.ac index 8aa42a92d..3c9a8b165 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=10 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws8 +EXTRA_VERSION=claws9 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/news.c b/src/news.c index caa76add9..06d396342 100644 --- a/src/news.c +++ b/src/news.c @@ -48,8 +48,6 @@ #include "inputdialog.h" #include "alertpanel.h" #include "log.h" -#include "mainwindow.h" -#include "inc.h" #if USE_OPENSSL # include "ssl.h" #endif @@ -1157,46 +1155,6 @@ MsgInfo *news_get_msginfo(Folder *folder, FolderItem *item, gint num) return msginfo; } -/*! - *\brief Set/reset/update progressbar, max. 10 redraws/second - * - *\param action What to do with the statusbar - * = 0 : Reset to zero - * < 0 : Init maximum to -(action) - * > 0 : Increase by (action) - */ -void news_doprogress(glong action) { - static glong curcount=0; - static glong maxval; - static MainWindow *mainwin=0; - static struct timeval tv_prev, tv_cur; - - if (!mainwin) - mainwin = mainwindow_get_mainwindow(); - g_return_if_fail(mainwin); - - if (action < 0) - maxval = -action; - else if (action == 0) { - curcount=0; - gtk_progress_bar_update( - GTK_PROGRESS_BAR(mainwin->progressbar), 0.0); - } else { - curcount += action; - gettimeofday(&tv_cur, NULL); - if (!(tv_cur.tv_sec - tv_prev.tv_sec > 0 || - tv_cur.tv_usec - tv_prev.tv_usec > 100) - || !maxval) - return; - - gtk_progress_bar_update( - GTK_PROGRESS_BAR(mainwin->progressbar), - (float)curcount/maxval); - while (gtk_events_pending()) gtk_main_iteration (); - gettimeofday(&tv_prev, NULL); - } -} - static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *item, guint begin, guint end) { gchar buf[NNTPBUFSIZE]; @@ -1207,22 +1165,18 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite g_return_val_if_fail(session != NULL, NULL); g_return_val_if_fail(item != NULL, NULL); - inc_lock(); log_message(_("getting xover %d - %d in %s...\n"), begin, end, item->path); if (nntp_xover(session->nntp_sock, begin, end) != NN_SUCCESS) { log_warning(_("can't get xover\n")); - goto unlock_leave; + return NULL; } - news_doprogress(-3*(end-begin)); - statusbar_print_all(_("Getting overview (%d articles)..."),end-begin); for (;;) { if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) { log_warning(_("error occurred while getting xover.\n")); - goto unlock_leave; + return newlist; } - news_doprogress(1); if (buf[0] == '.' && buf[1] == '\r') break; @@ -1247,19 +1201,16 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite if (nntp_xhdr(session->nntp_sock, "to", begin, end) != NN_SUCCESS) { log_warning(_("can't get xhdr\n")); - goto unlock_leave; + return newlist; } llast = newlist; - statusbar_pop_all(); - statusbar_print_all(_("Getting headers (%d articles)..."),end-begin); for (;;) { if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) { log_warning(_("error occurred while getting xhdr.\n")); - goto unlock_leave; + return newlist; } - news_doprogress(1); if (buf[0] == '.' && buf[1] == '\r') break; if (!llast) { @@ -1275,19 +1226,16 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite if (nntp_xhdr(session->nntp_sock, "cc", begin, end) != NN_SUCCESS) { log_warning(_("can't get xhdr\n")); - goto unlock_leave; + return newlist; } llast = newlist; - statusbar_pop_all(); - statusbar_print_all(_("Getting crossposted articles (%d messages)..."),end-begin); for (;;) { if (sock_gets(SESSION(session)->sock, buf, sizeof(buf)) < 0) { log_warning(_("error occurred while getting xhdr.\n")); - goto unlock_leave; + return newlist; } - news_doprogress(1); if (buf[0] == '.' && buf[1] == '\r') break; if (!llast) { @@ -1301,10 +1249,6 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite llast = llast->next; } -unlock_leave: - news_doprogress(0); - statusbar_pop_all(); - inc_unlock(); return newlist; } -- 2.25.1