Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--services/clipboard/clipboardobject.py3
-rw-r--r--services/clipboard/clipboardservice.py6
-rw-r--r--shell/view/clipboardmenu.py2
4 files changed, 9 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 07859a3..73a9539 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+* #2268 Allow removing downloads from the clipboard while in progress. (tomeu)
* #2240 Ensure activity uniquness in the shell. (marco)
Snapshot f6f3f2b520
diff --git a/services/clipboard/clipboardobject.py b/services/clipboard/clipboardobject.py
index 7de4730..d751274 100644
--- a/services/clipboard/clipboardobject.py
+++ b/services/clipboard/clipboardobject.py
@@ -134,7 +134,8 @@ class Format:
def destroy(self):
if self._on_disk:
uri = urlparse.urlparse(self._data)
- os.remove(uri.path)
+ if os.path.isfile(uri.path):
+ os.remove(uri.path)
def get_type(self):
return self._type
diff --git a/services/clipboard/clipboardservice.py b/services/clipboard/clipboardservice.py
index 569ed6b..639f29c 100644
--- a/services/clipboard/clipboardservice.py
+++ b/services/clipboard/clipboardservice.py
@@ -127,9 +127,13 @@ class ClipboardService(dbus.service.Object):
in_signature="o", out_signature="a{sv}")
def get_object(self, object_path):
logging.debug('ClipboardService.get_object')
+
+ if not self._objects.has_key(str(object_path)):
+ return dbus.Dictionary({}, signature='sv')
+
cb_object = self._objects[str(object_path)]
formats = cb_object.get_formats()
- format_types = dbus.Array([], 's')
+ format_types = dbus.Array([], signature='s')
for type, format in formats.iteritems():
format_types.append(type)
diff --git a/shell/view/clipboardmenu.py b/shell/view/clipboardmenu.py
index 0bc3b9e..95e6192 100644
--- a/shell/view/clipboardmenu.py
+++ b/shell/view/clipboardmenu.py
@@ -94,7 +94,7 @@ class ClipboardMenu(Palette):
#self._stop_item.props.sensitive = False
self._journal_item.props.sensitive = True
else:
- self._remove_item.props.sensitive = False
+ self._remove_item.props.sensitive = True
self._open_item.props.sensitive = False
# TODO: reenable the stop item when we implement stoping downloads.
#self._stop_item.props.sensitive = True