Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services/shell/clipboardobject.py
diff options
context:
space:
mode:
Diffstat (limited to 'services/shell/clipboardobject.py')
-rw-r--r--services/shell/clipboardobject.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/services/shell/clipboardobject.py b/services/shell/clipboardobject.py
index c3cdab3..ea5a9a1 100644
--- a/services/shell/clipboardobject.py
+++ b/services/shell/clipboardobject.py
@@ -95,17 +95,21 @@ class ClipboardObject:
format = mime.choose_most_significant(self._formats.keys())
- if format == 'text/uri-list':
+ uri = None
+ if format == 'XdndDirectSave0':
+ uri = self._formats['XdndDirectSave0'].get_data()
+ elif format == 'text/uri-list':
data = self._formats['text/uri-list'].get_data()
- uris = data.split('\n')
- if len(uris) == 1 or not uris[1]:
- uri = urlparse.urlparse(uris[0], 'file')
- if uri.scheme == 'file':
- if os.path.exists(uri.path):
- format = mime.get_for_file(uri.path)
- else:
- format = mime.get_from_file_name(uri.path)
- logging.debug('Choosed %r!' % format)
+ uri = data.split('\n')[0]
+
+ if uri:
+ uri = urlparse.urlparse(uri, 'file')
+ if uri.scheme == 'file':
+ if os.path.exists(uri.path):
+ format = mime.get_for_file(uri.path)
+ else:
+ format = mime.get_from_file_name(uri.path)
+ logging.debug('Choosed %r!' % format)
return format