0.8.10claws79
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 3 Mar 2003 21:49:30 +0000 (21:49 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 3 Mar 2003 21:49:30 +0000 (21:49 +0000)
* src/news.c
        have to multiply the percentage of the current fetch with
        the percentage that it has of the total fetch operation
        for correct values

ChangeLog.claws
configure.ac
src/news.c
src/news.h

index 208d8b5..224dad8 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-03 [christoph] 0.8.10claws79
+
+       * src/news.c
+               have to multiply the percentage of the current fetch with
+               the percentage that it has of the total fetch operation
+               for correct values
+
 2003-03-03 [christoph] 0.8.10claws78
 
        * src/news.c
index 3ebfb4a..790628f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws78
+EXTRA_VERSION=claws79
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index c4dc09b..c3a10cf 100644 (file)
@@ -919,7 +919,9 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
                }
                count++;
                progressindicator_set_percentage
-                       (PROGRESS_TYPE_NETWORK, session->fetch_base_percentage + ((gfloat) count / (gfloat) lines));
+                       (PROGRESS_TYPE_NETWORK,
+                        session->fetch_base_percentage +
+                        (((gfloat) count) / ((gfloat) lines)) * session->fetch_total_percentage);
 
                if (buf[0] == '.' && buf[1] == '\r') break;
 
@@ -956,7 +958,9 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
                }
                count++;
                progressindicator_set_percentage
-                       (PROGRESS_TYPE_NETWORK, session->fetch_base_percentage + ((gfloat) count / (gfloat) lines));
+                       (PROGRESS_TYPE_NETWORK,
+                        session->fetch_base_percentage +
+                        (((gfloat) count) / ((gfloat) lines)) * session->fetch_total_percentage);
 
                if (buf[0] == '.' && buf[1] == '\r') break;
                if (!llast) {
@@ -984,7 +988,9 @@ static GSList *news_get_msginfos_for_range(NNTPSession *session, FolderItem *ite
                }
                count++;
                progressindicator_set_percentage
-                       (PROGRESS_TYPE_NETWORK, session->fetch_base_percentage + ((gfloat) count / (gfloat) lines));
+                       (PROGRESS_TYPE_NETWORK,
+                        session->fetch_base_percentage +
+                        (((gfloat) count) / ((gfloat) lines)) * session->fetch_total_percentage);
 
                if (buf[0] == '.' && buf[1] == '\r') break;
                if (!llast) {
@@ -1033,7 +1039,8 @@ GSList *news_get_msginfos(Folder *folder, FolderItem *item, GSList *msgnum_list)
        for(elem = g_slist_next(tmp_msgnum_list); elem != NULL; elem = g_slist_next(elem)) {
                next = GPOINTER_TO_INT(elem->data);
                if(next != (last + 1)) {
-                       session->fetch_base_percentage = (gfloat) fetched / (gfloat) tofetch;
+                       session->fetch_base_percentage = ((gfloat) fetched) / ((gfloat) tofetch);
+                       session->fetch_total_percentage = ((gfloat) (last - first + 1)) / ((gfloat) tofetch);
                        tmp_msginfo_list = news_get_msginfos_for_range(session, item, first, last);
                        msginfo_list = g_slist_concat(msginfo_list, tmp_msginfo_list);
                        fetched = last - first + 1;
@@ -1041,6 +1048,8 @@ GSList *news_get_msginfos(Folder *folder, FolderItem *item, GSList *msgnum_list)
                }
                last = next;
        }
+       session->fetch_base_percentage = ((gfloat) fetched) / ((gfloat) tofetch);
+       session->fetch_total_percentage = ((gfloat) (last - first + 1)) / ((gfloat) tofetch);
        tmp_msginfo_list = news_get_msginfos_for_range(session, item, first, last);
        msginfo_list = g_slist_concat(msginfo_list, tmp_msginfo_list);
 
index 622d425..c3c2884 100644 (file)
@@ -48,6 +48,7 @@ struct _NNTPSession
        NNTPSockInfo *nntp_sock;
        gchar *group;
        gfloat fetch_base_percentage;
+       gfloat fetch_total_percentage;
 };
 
 struct _NewsGroupInfo