[Webkit-unassigned] [Bug 32925] [Qt] Add Open File dialog to QtLauncher
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Dec 29 08:54:40 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=32925
--- Comment #7 from Daniel Bates <dbates at webkit.org> 2009-12-29 08:54:39 PST ---
(In reply to comment #4)
> (From update of attachment 45480 [details])
>
> > + QFileDialog fileDialog(this, tr("Open"), "", filter);
>
> Please use QString() instead of "".
>
Will do.
> > + fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
> > + fileDialog.setFileMode(QFileDialog::ExistingFile);
> > + fileDialog.setOptions(QFileDialog::ReadOnly);
> > +
> > + if (fileDialog.exec()) {
> > + QString selectedFile = fileDialog.selectedFiles()[0];
> > + if (!selectedFile.isEmpty()) {
> > + QUrl fileURL("file://" + selectedFile);
>
> This should be done using QUrl::fromLocalFile instead, to convert slashes
> correctly, support drives on Windows and support spaces in filenames, etc.
>
Will do.
> > + void loadURL(const QUrl& url)
> > + {
> > + if (!url.isValid())
> > + return;
> > +
> > + urlEdit->setText(url.toEncoded());
>
> That doesn't look correct. toEncoded() returns a QByteArray, urlEdit takes a
> QString. The conversion from a QByteArray to a QString must be done using a
> known encoding. It seems the use of toString() would be better.
Will do. Will also make this change to line 221
<http://trac.webkit.org/browser/trunk/WebKitTools/QtLauncher/main.cpp?rev=52601#L221>.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list