Review Request 129054: [WIP]Port to KF5/KDevelop5
Alexander Zhigalin
alexander at zhigalin.tk
Wed Nov 2 12:12:56 UTC 2016
> On Сен. 27, 2016, 8:07 п.п., Alexander Zhigalin wrote:
> > browserappjob.cpp, line 72
> > <https://git.reviewboard.kde.org/r/129054/diff/1/?file=481375#file481375line72>
> >
> > By unknown reason it assumes m_url is a local file
>
> Aleix Pol Gonzalez wrote:
> Then please make sure the input is sanitized.
>
> Alexander Zhigalin wrote:
> The sanitization is the thing which causes the problem
>
> Alexander Zhigalin wrote:
> `m_url` is constructed like
>
> ```C++
> url.setScheme("http");
> url.setHost(host);
> url.setPath(path);
> url.setQuery(q);
> return url;
> ```
>
> But somehow it thoughts `m_url` is a local path and `QUrl::fromUserInput()` is making it work.
> Maybe is a `QUrl` or `QDesktopServices::openUrl()` bug.
>
> Aleix Pol Gonzalez wrote:
> I don't believe that a url with http scheme can be turned into local, there must be something we're missing. Can you maybe make a small test application so we can see what you mean?
>
> Alexander Zhigalin wrote:
> > I don't believe that a url with http scheme can be turned into local
>
> It just does.
> Something happens inside `QDesktopServices::openUrl()` and it becomes a local url.
> But using `QUrl::fromUserInput()` it behaves correctly.
>
> P.S. It also behaves correctly if `m_url` is a valid internet URL (no localhost, no 127.0.0.1, no 404 errors) like http://google.com/index.html
>
> Aleix Pol Gonzalez wrote:
> That's why I asked for a test case, so we can fix QUrl if necessary.
>
> Alexander Zhigalin wrote:
> Sadly I have too less knowledge to make it (I am a PHP dev after all).
> The code which is opening that URL is
> ```C++
> return url.scheme() == QLatin1String("file") ?
> platformServices->openDocument(url) : platformServices->openUrl(url);
> ```
> I have no clue why, but it seems to select `openDocument()` instead of `openUrl()`...
Update:
I have not tried it for a while and now things seems changed.
My hack with `QUrl::fromUserInput()` is not working anymore.
But local URLs are now working and I were not able to construct any valid URL which won't pass.
So I think I'll drop it.
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129054/#review99598
-----------------------------------------------------------
On Ноя. 1, 2016, 9:29 п.п., Alexander Zhigalin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129054/
> -----------------------------------------------------------
>
> (Updated Ноя. 1, 2016, 9:29 п.п.)
>
>
> Review request for KDevelop.
>
>
> Repository: kdev-executebrowser
>
>
> Description
> -------
>
> Port to KF5/KDevelop5
>
>
> Diffs
> -----
>
> CMakeLists.txt 24ea572d6df7cc3b5fa485e7dff068354e0dfc8c
> browserappconfig.h b26c32215dbf15f142aec63fe2ac180bb172c38e
> browserappconfig.cpp b7c8a4aed6ed44a069dec57a3e600eeeb8a8ed62
> browserappconfig.ui ef205fc6a1edd6cc68e42f5588542a3cd4d764cd
> browserappjob.h 37ff7008088706096f73c6da49b46c9234231a0d
> browserappjob.cpp a211205aa69b2acc993493b36169c6c1a4cc7b05
> cmake/FindKDevPlatform.cmake 1a771c52510cb3e71c19b8a1c84680b6a3c64d08
> executebrowserplugin.h 7c787338faeb4fb0749466bb911751c5d72b9093
> executebrowserplugin.cpp 95a77aa11ccc97a7625a895032fbb773409cd11e
> iexecutebrowserplugin.h f7866227cc8ec0f5946cc78ad35be704ce3aa4f0
> kdevexecutebrowser.desktop b5ed913a0f9ed5c4f7b62578f2705560eda48135
>
> Diff: https://git.reviewboard.kde.org/r/129054/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alexander Zhigalin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20161102/4aa31f46/attachment-0001.html>
More information about the KDevelop-devel
mailing list