RESOLVED FIXED 25823
[Qt] Add API to generate a QUrl from a user string url
https://bugs.webkit.org/show_bug.cgi?id=25823
Summary [Qt] Add API to generate a QUrl from a user string url
Benjamin Meyer
Reported 2009-05-15 07:55:44 PDT
Add an API to generate a QUrl out of a string correcting for errors and missing information. See the API documentation for more details about the function.
Attachments
the patch with the api (13.70 KB, patch)
2009-05-15 07:56 PDT, Benjamin Meyer
zecke: review+
Benjamin Meyer
Comment 1 2009-05-15 07:56:16 PDT
Created attachment 30387 [details] the patch with the api
Kenneth Rohde Christiansen
Comment 2 2009-05-15 14:49:47 PDT
The patch is OK with me, and the autotest is definately a plus. The reviewer might point out that this is probably not the best place for having such a function and that it should be in QUrl, but as it makes many web assumptions, that has been rejected. Thus QWebView seems like the best place to put such functionality, that taken in consideration.
Eric Seidel (no email)
Comment 3 2009-05-21 20:10:17 PDT
Comment on attachment 30387 [details] the patch with the api Personally I don't think this is a very good idea for Qt to expose. "Guessing the URL" only helps on the first request. After that there are redirects and URL re-writes and JavaScrpt which are going to cause the final URL to change quite a bit, making exposing this API less useful. But I don't work on the Qt port. So I'll let a Qt reviewer review this.
Holger Freyther
Comment 4 2009-05-22 21:49:44 PDT
Comment on attachment 30387 [details] the patch with the api > + If that is not the case, an attempt is made to turn the string into a > + http:// or ftp:// URL. The latter in the case the string starts with > + 'ftp'. The result is then passed through QUrl's tolerant parser, and > + in the case or success, a valid QUrl is returned, orelse a QUrl(). orelse??? space missing? > + QUrl url = view->guessUrlFromString(string); my taste would say to use the static type QWebView::guessUrlFromString... ignore that at your will.. are you sure that QWebView is the best place for that? If I have a QWebPage in a graphics view item I still want to use the guessing and using QWebView might not feel right. Do you think QWebView is the best place to put it? what about QWebPage?
Holger Freyther
Comment 5 2009-05-26 23:37:16 PDT
Okay landed as is in r44180. Didn't know if you have commit access or not... I will await the usual API review that will happen before 4.6.
Note You need to log in before you can comment on or make changes to this bug.