Fix clipboard support for text from Browse.

This commit is contained in:
Tomeu Vizoso 2007-07-28 16:00:32 +02:00
parent 1f58acf9dd
commit d988d1dfd2
2 changed files with 7 additions and 2 deletions

1
NEWS
View File

@ -1,3 +1,4 @@
* Fix clipboard support for text from Browse. (tomeu)
* #2511 Fix journal entries background in the object chooser. (tomeu) * #2511 Fix journal entries background in the object chooser. (tomeu)
* Activity launching now timeout after 120 seconds. (marco) * Activity launching now timeout after 120 seconds. (marco)
* Add timeout arg to sugar.datastore.Datastore. (tomeu) * Add timeout arg to sugar.datastore.Datastore. (tomeu)

View File

@ -59,8 +59,10 @@ def choose_most_significant(mime_types):
continue continue
if mime_type.startswith(mime_category): if mime_type.startswith(mime_category):
# skip mozilla private types (second component starts with '_') # skip mozilla private types (second component starts with '_'
if mime_type.split('/')[1].startswith('_'): # or ends with '-priv')
if mime_type.split('/')[1].startswith('_') or \
mime_type.split('/')[1].endswith('-priv'):
continue continue
# take out the specifier after ';' that mozilla likes to add # take out the specifier after ';' that mozilla likes to add
@ -69,9 +71,11 @@ def choose_most_significant(mime_types):
return mime_type return mime_type
if 'text/html' in mime_types: if 'text/html' in mime_types:
logging.debug('Choosed text/html!')
return 'text/html' return 'text/html'
if 'text/plain' in mime_types or 'STRING' in mime_types: if 'text/plain' in mime_types or 'STRING' in mime_types:
logging.debug('Choosed text/plain!')
return 'text/plain' return 'text/plain'
logging.debug('Returning first: %r.' % mime_types[0]) logging.debug('Returning first: %r.' % mime_types[0])