Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-09 13:04:26 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-09-09 13:04:26 (GMT)
commit547df751a762065292156bc321d335fb4158b48d (patch)
tree5423f2128d5506afc1e89adccd9ceae738760b20 /services
parenteb7ad2066c61afc4ac62a6635d375a0c2f0c421e (diff)
Fixed some issues with text objects in the clipboard.
Diffstat (limited to 'services')
-rw-r--r--services/shell/clipboardservice.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/services/shell/clipboardservice.py b/services/shell/clipboardservice.py
index 90e1b8e..6671fbf 100644
--- a/services/shell/clipboardservice.py
+++ b/services/shell/clipboardservice.py
@@ -80,7 +80,7 @@ class ClipboardService(dbus.service.Object):
cb_object.add_format(Format(format_type, new_uri, on_disk))
logging.debug('Added format of type ' + format_type + ' with path at ' + new_uri)
else:
- cb_object.add_format(Format(format_type, data, on_disk))
+ cb_object.add_format(Format(format_type, data, on_disk))
logging.debug('Added in-memory format of type ' + format_type + '.')
self.object_state_changed(object_path, {NAME_KEY: cb_object.get_name(),
@@ -112,11 +112,25 @@ class ClipboardService(dbus.service.Object):
cb_object.set_percent(percent)
if percent == 100:
- for format_name, format in cb_object.get_formats().iteritems():
+ formats = cb_object.get_formats()
+ for format_name, format in formats.iteritems():
if format.is_on_disk():
new_uri = self._copy_file(format.get_data())
format.set_data(new_uri)
+ # Add a text/plain format to objects that are text but lack it
+ if 'text/plain' not in formats.keys():
+ if 'UTF8_STRING' in formats.keys():
+ self.add_object_format(object_path,
+ 'text/plain',
+ data=formats['UTF8_STRING'].get_data(),
+ on_disk=False)
+ elif 'text/unicode' in formats.keys():
+ self.add_object_format(object_path,
+ 'text/plain',
+ data=formats['UTF8_STRING'].get_data(),
+ on_disk=False)
+
self.object_state_changed(object_path, {NAME_KEY: cb_object.get_name(),
PERCENT_KEY: percent,
ICON_KEY: cb_object.get_icon(),