#2268 Allow removing downloads from the clipboard while in progress.

This commit is contained in:
Tomeu Vizoso
2007-07-20 20:45:22 +02:00
parent c07e61509b
commit 6e6fd02322
4 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -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
+5 -1
View File
@@ -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)