Bug 26710 - [Qt] Qt needs Clipboard::files() implementation
Summary: [Qt] Qt needs Clipboard::files() implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: QtWebKit Unassigned
URL:
Keywords: Qt, QtTriaged
Depends on: 31332
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-24 23:47 PDT by Eric Seidel (no email)
Modified: 2010-12-14 02:50 PST (History)
7 users (show)

See Also:


Attachments
Proposed patch (1.84 KB, patch)
2010-12-12 22:09 PST, Jarred Nicholls
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-06-24 23:47:53 PDT
[Qt] Qt needs Clipboard::files() implementation

So that WebKit properly supports drag and drop of files onto web pages.  See bug 25916
Comment 1 Benjamin Meyer 2009-10-03 21:50:41 PDT
Is there a test page for this feature?  Is it suppose to return the file names ore the file contents?

First pass:

 PassRefPtr<FileList> ClipboardQt::files() const
 {
-    notImplemented();
-    return 0;
+    if (policy() != ClipboardReadable)
+        return FileList::create();
+
+    RefPtr<FileList> fileList = FileList::create();
+    QList<QUrl> urls = m_readableData->urls();
+    foreach (QUrl url, urls) {
+        if (url.scheme() != QLatin1String("file"))
+            continue;
+        fileList->append(File::create(url.toLocalFile()));
+    }
+
+    return fileList.release();
 }
Comment 2 Eric Seidel (no email) 2009-10-07 21:56:19 PDT
There are several tests.  Qt's DumpRenderTree needs a eventSender.beginDragWithFiles implementation.  There is a bug filed about Windows DumpRenderTree (bug 25924), but I don't see one for Qt yet.
Comment 3 Robert Hogan 2010-12-04 02:37:43 PST
Currently drag'n'drop in Qt DRT is pretty much intractable, see https://bugs.webkit.org/show_bug.cgi?id=31332
Comment 4 Jarred Nicholls 2010-12-12 21:23:51 PST
Tests depend upon beginDragWithFiles implementation in DRT, so you can mark this bug as depending upon this one: https://bugs.webkit.org/show_bug.cgi?id=50902
Comment 5 Jarred Nicholls 2010-12-12 22:09:29 PST
Created attachment 76352 [details]
Proposed patch
Comment 6 Benjamin Meyer 2010-12-14 01:40:10 PST
yah!
Comment 7 WebKit Commit Bot 2010-12-14 02:50:22 PST
Comment on attachment 76352 [details]
Proposed patch

Clearing flags on attachment: 76352

Committed r74009: <http://trac.webkit.org/changeset/74009>
Comment 8 WebKit Commit Bot 2010-12-14 02:50:28 PST
All reviewed patches have been landed.  Closing bug.