From fe82b7058990b2ed6f6398a15f3fac6492ae69e5 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sat, 15 Dec 2007 18:28:02 +0000 Subject: Update the progress of downloads less often #5449. --- diff --git a/NEWS b/NEWS index 2a6cde9..cd0469a 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,18 @@ -79 +* Update the progress of downloads less often #5449 (tomeu) +79 +* Missing file for: Open an uri of type text/uri-list with browse #5080 +(erikos) -77 +78 * Give to the DS the ownership of the files we hand to it #5235 (tomeu) * Open an uri of type text/uri-list with browse #5080 (erikos) * Save view source to SAR/instance #5251 (erikos) * Move the profile in SAR/data #5221 (erikos) +77 + 76 * Added OLPC root CA support (marco, erikos) diff --git a/downloadmanager.py b/downloadmanager.py index 07374f1..7b1af9c 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -48,6 +48,9 @@ DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore' DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore' DS_DBUS_PATH = '/org/laptop/sugar/DataStore' +_MIN_TIME_UPDATE = 5 # In seconds +_MIN_PERCENT_UPDATE = 10 + _browser = None _temp_path = '/tmp' def init(browser, activity, temp_path): @@ -214,8 +217,8 @@ class Download: path, file_name = os.path.split(self._target_file.path) percent = (cur_self_progress * 100) / max_self_progress - if (time.time() - self._last_update_time) < 5 and \ - (percent - self._last_update_percent) < 5: + if (time.time() - self._last_update_time) < _MIN_TIME_UPDATE and \ + (percent - self._last_update_percent) < _MIN_PERCENT_UPDATE: return self._last_update_time = time.time() -- cgit v0.9.1