src/gui/kernel/qclipboard_mac.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/src/gui/kernel/qclipboard_mac.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/kernel/qclipboard_mac.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -388,6 +388,18 @@
         clear_helper();
         QStringList formats = mime_src->formats();
 
+#ifdef QT_MAC_USE_COCOA
+        // QMimeData sub classes reimplementing the formats() might not expose the
+        // temporary "application/x-qt-mime-type-name" mimetype. So check the existence
+        // of this mime type while doing drag and drop.
+        QString dummyMimeType(QLatin1String("application/x-qt-mime-type-name"));
+        if (!formats.contains(dummyMimeType)) {
+            QByteArray dummyType = mime_src->data(dummyMimeType);
+            if (!dummyType.isEmpty()) {
+                formats.append(dummyMimeType);
+            }
+        }
+#endif
         for(int f = 0; f < formats.size(); ++f) {
             QString mimeType = formats.at(f);
             for (QList<QMacPasteboardMime *>::Iterator it = availableConverters.begin(); it != availableConverters.end(); ++it) {