Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--downloadmanager.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 354cbaf..f54cfe2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+* #2268 Allow removing downloads from the clipboard while in progress. (tomeu)
+
31
* Fix stop button icon. (marco)
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)