revert news progressbar (GUI separation)
authorThorsten Maerz <torte@netztorte.de>
Thu, 13 Feb 2003 19:05:55 +0000 (19:05 +0000)
committerThorsten Maerz <torte@netztorte.de>
Thu, 13 Feb 2003 19:05:55 +0000 (19:05 +0000)
ChangeLog.claws
configure.ac
src/news.c

index 97613e9..fd90378 100644 (file)
@@ -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
index 8aa42a9..3c9a8b1 100644 (file)
@@ -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
index caa76ad..06d3963 100644 (file)
@@ -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;
 }