Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/downloadmanager.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-20 18:47:48 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-20 18:47:48 (GMT)
commitb3f0b16b8772317e2157e31364034365b3346631 (patch)
treece3ff4259082c6a5faa59fd1dfeb9925c5dadb38 /downloadmanager.py
parent2523babd3abb4f0c46890cda42591d5cf6d24a20 (diff)
#2268 Allow removing downloads from the clipboard while in progress.
Diffstat (limited to 'downloadmanager.py')
-rw-r--r--downloadmanager.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/downloadmanager.py b/downloadmanager.py
index 78e4e0d..b4486af 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -87,7 +87,10 @@ class Download:
return
cb_service = clipboardservice.get_instance()
- cb_service.set_object_percent(self._cb_object_id, 100)
+ # Test if the object still exists in the clipboard as it could have
+ # been removed.
+ if cb_service.get_object(self._cb_object_id):
+ cb_service.set_object_percent(self._cb_object_id, 100)
path, file_name = os.path.split(self._target_file.path)
@@ -123,7 +126,10 @@ class Download:
datastore.write(self._dl_jobject)
cb_service = clipboardservice.get_instance()
- cb_service.set_object_percent(self._cb_object_id, percent)
+ # Test if the object still exists in the clipboard as it could have
+ # been removed.
+ if cb_service.get_object(self._cb_object_id):
+ cb_service.set_object_percent(self._cb_object_id, percent)
def _create_journal_object(self):
path, file_name = os.path.split(self._target_file.path)