#2268 Allow removing downloads from the clipboard while in progress.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user