#5664 HIGH Retriag: Copying formatted text out of Browse breaks Journal/clipboard interaction
Zarro Boogs per Child
bugtracker at laptop.org
Fri Jan 4 11:28:41 EST 2008
#5664: Copying formatted text out of Browse breaks Journal/clipboard interaction
------------------------------+---------------------------------------------
Reporter: legutierr | Owner: tomeu
Type: defect | Status: new
Priority: high | Milestone: Retriage, Please!
Component: browse-activity | Version: Development build as of this date
Resolution: | Keywords:
Verified: 0 | Blocking:
Blockedby: |
------------------------------+---------------------------------------------
Changes (by tomeu):
* cc: marco, erikos (added)
* owner: erikos => tomeu
* milestone: Update.1 => Retriage, Please!
Comment:
Ok, then the problem is that the text/html target that comes out from
mozilla is in utf-16 and xdgmime/gnomevfs cannot sniff the format.
Looks like we shouldn't rely so much on mime type sniffing. This patch
will fall back to the target name if xdgmime/gnomevfs cannot sniff
correctly the mime:
{{{
diff --git a/shell/view/clipboardmenu.py b/shell/view/clipboardmenu.py
index b847828..90c8a0e 100644
--- a/shell/view/clipboardmenu.py
+++ b/shell/view/clipboardmenu.py
@@ -207,7 +207,11 @@ class ClipboardMenu(Palette):
else:
file_path = self._write_to_temp_file(data['DATA'])
transfer_ownership = True
- mime_type = mime.get_for_file(file_path)
+ sniffed_mime_type = mime.get_for_file(file_path)
+ if sniffed_mime_type == 'application/octet-stream':
+ mime_type = format
+ else:
+ mime_type = sniffed_mime_type
jobject = datastore.create()
jobject.metadata['title'] = _('Clipboard object: %s.') %
obj['NAME']
}}}
Jim: although the patch looks straightforward, I think we shouldn't apply
it to update.1, as saving clippings to the journal doesn't look to me as a
very common operation.
--
Ticket URL: <http://dev.laptop.org/ticket/5664#comment:7>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system
More information about the Bugs
mailing list