kde-open5 bug help needed

Albert Astals Cid aacid at kde.org
Tue May 9 14:14:07 BST 2017


El dimecres, 3 de maig de 2017, a les 12:06:14 CEST, Andrea Scarpino va 
escriure:
> Hi all,
> 
> I hit a bug[1][2] in kde-open5 when using
> QDesktopServices::openUrl(myUrl) to open the system browser.
> 
> The issue is that, since myUrl redirects to another page, kde-open5
> (used under the hood by QDesktopServices because
> XDG_CURRENT_DESKTOP=KDE is set) "fetches" the redirection url and then
> open the browser at the redirected url; for my workflow this is bad
> because myUrl generate a cookie and then you have no such cookie when
> the browser starts.
> 
> I debugged the flow and I understood that since
> redirectionHandlingEnabled is enabled by default, this[3] statement in
> transferjob.cpp handles the redirection.
> Then I disabled the redirection in krun.cpp[4] (invoked under the hood
> by kde-open5), but this broke kde-open5 because it "never ends", but
> instead waits for some event.
> I suspect foundMimeType() should be call (which is triggered when
> mimetype signal is emitted[5], but with
> redirectionHandlingEnabled=false this switch case[6] is never
> triggered and then mimetype signal isn't emit.
> 
> What should be the workflow without redirection? Any KIO hacker out there?
> :-)

The problem I think is that you need to make the slave aware that it should 
not do the redirection, i.e. 
  void redirection(const QUrl &_url);
should turn into
  bool redirection(const QUrl &_url);

And then on http.cpp set m_isRedirection to false if redirection(u); returns 
false so that mimeType(m_mimeType); is called down that function because we're 
not doing redirection anymore.

Do you feel like trying to hack that on?

Cheers,
  Albert

P.S: actually we would need a redirectionV2 since we can't change the 
signature of a public function

> 
> I'm also on #kde-devel.
> 
> Thank you!
> 
> [1] https://bugs.kde.org/show_bug.cgi?id=354246
> [2] https://bugs.kde.org/show_bug.cgi?id=364662
> [3] https://cgit.kde.org/kio.git/tree/src/core/transferjob.cpp#n114
> [4] https://cgit.kde.org/kio.git/tree/src/widgets/krun.cpp#n1147
> [5] https://cgit.kde.org/kio.git/tree/src/widgets/krun.cpp#n1151
> [6] https://cgit.kde.org/kio.git/tree/src/core/slaveinterface.cpp#n250






More information about the kde-core-devel mailing list