[PATCH] #2570 Accept correctly image drops from Record.

Tomeu Vizoso tomeu
Sun Jul 29 05:03:09 EDT 2007


---
 NEWS                                     |    1 +
 shell/view/frame/clipboardpanelwindow.py |   19 +++++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index c9c76eb..b52c28f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+* #2570 Accept correctly image drops from Record.
 * Add WPA support (miguel, dcbw)
 * Fix clipboard support for text from Browse. (tomeu)
 
diff --git a/shell/view/frame/clipboardpanelwindow.py b/shell/view/frame/clipboardpanelwindow.py
index 3e2f626..70b87e4 100644
--- a/shell/view/frame/clipboardpanelwindow.py
+++ b/shell/view/frame/clipboardpanelwindow.py
@@ -86,7 +86,18 @@ class ClipboardPanelWindow(FrameWindow):
             logging.debug('adding type ' + selection.type + '.')
                         
             cb_service = clipboardservice.get_instance()
-            cb_service.add_object_format(key, 
-                                  selection.type,
-                                  selection.data,
-                                  on_disk = False)
+            if selection.type == 'text/uri-list':
+                uris = selection.data.split('\n')
+                if len(uris) > 1:
+                    raise NotImplementedError('Multiple uris in text/uri-list still not supported.')
+
+                cb_service.add_object_format(key,
+                                             selection.type,
+                                             uris[0],
+                                             on_disk=True)
+            else:
+                cb_service.add_object_format(key, 
+                                             selection.type,
+                                             selection.data,
+                                             on_disk=False)
+
-- 
1.5.2.3


--=-RitHFy8kgAF/chsd4HPx--




More information about the Sugar-devel mailing list