Some more exceptions for mozilla drops.
This commit is contained in:
parent
d6bf24e456
commit
de2c9c5322
@ -105,11 +105,15 @@ class ClipboardObject:
|
||||
|
||||
for mime_category in ['image/', 'text/', 'application/']:
|
||||
for mime_type in self._formats.keys():
|
||||
if mime_type.startswith(mime_category):
|
||||
if mime_type.startswith(mime_category) and \
|
||||
not mime_type.split('/')[1].startswith('_'):
|
||||
mime_type = mime_type.split(';')[0]
|
||||
logging.debug('Choosed %r!' % mime_type)
|
||||
return mime_type
|
||||
|
||||
if 'STRING' in self._formats.keys():
|
||||
return 'text/plain'
|
||||
|
||||
logging.debug('Returning first: %r.' % self._formats.keys()[0])
|
||||
return self._formats.keys()[0]
|
||||
|
||||
|
@ -22,7 +22,6 @@ import dbus.service
|
||||
from sugar import env
|
||||
from sugar import util
|
||||
from clipboardobject import ClipboardObject, Format
|
||||
import typeregistry
|
||||
|
||||
NAME_KEY = 'NAME'
|
||||
PERCENT_KEY = 'PERCENT'
|
||||
|
@ -31,7 +31,7 @@ class ObjectTypeRegistry(dbus.service.Object):
|
||||
from gettext import gettext as _
|
||||
self._add_primitive('Text', _('Text'), 'theme:object-text',
|
||||
[ 'text/plain', 'text/rtf', 'application/pdf',
|
||||
'application/x-pdf' ])
|
||||
'application/x-pdf', 'text/html' ])
|
||||
self._add_primitive('Image', _('Image'), 'theme:object-image',
|
||||
[ 'image/png', 'image/gif', 'image/jpeg' ])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user