aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/ephy-tab.c16
2 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 55e234a99..28ef05166 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2003-08-07 Marco Pesenti Gritti <marco@it.gnome.org>
+ * src/ephy-tab.c: (build_load_percent):
+
+ Clamp the values to 0/100, mozilla sometimes report
+ more done requests than total requests, but their
+ progress widget clamp them.
+
+2003-08-07 Marco Pesenti Gritti <marco@it.gnome.org>
+
* embed/mozilla/mozilla-notifiers.cpp:
Dont set font prefs in mozilla when they are unset in
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index a84c0ce4f..e9643c56f 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -597,16 +597,24 @@ ephy_tab_title_cb (EphyEmbed *embed, EphyTab *tab)
}
static int
-build_load_percent (int bytes_loaded, int max_bytes_loaded)
+build_load_percent (int requests_done, int requests_total)
{
- if (max_bytes_loaded > 0)
+ int percent;
+
+ if (requests_total > 0)
{
- return (bytes_loaded * 100) / max_bytes_loaded;
+ percent = (requests_done * 100) / requests_total;
+
+ /* Mozilla sometimes report more done requests than
+ total requests. Their progress widget clamp the value */
+ percent = CLAMP (percent, 0, 100);
}
else
{
- return -1;
+ percent = -1;
}
+
+ return percent;
}
static char *