Review Request 127251: [KUnitConversion] Fix downloading currency exchange rates

David Faure faure at kde.org
Sat Mar 5 09:04:00 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127251/#review93183
-----------------------------------------------------------



I guess you couldn't trigger the mentionned crashes because I made KIO threadsafe meanwhile.

As to why this worked, well, it was a busy loop I guess, polling for bytesAvailable (and not waiting in waitForReadyRead)


src/currency.cpp (line 675)
<https://git.reviewboard.kde.org/r/127251/#comment63535>

    Pass the flag ExcludeUserInputEvents to avoid unexpected reentrancy when e.g. the user closes a window.
    
    A socket or a timer firing during the event loop can still create issues though, but there's no solution, other than moving all this to a separate thread.
    
    It's not the first job->exec() call in our code (which this is equivalent to) so I won't insist on that.


- David Faure


On March 2, 2016, 12:48 a.m., Kai Uwe Broulik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127251/
> -----------------------------------------------------------
> 
> (Updated March 2, 2016, 12:48 a.m.)
> 
> 
> Review request for KDE Frameworks and Vishesh Handa.
> 
> 
> Bugs: 345750
>     https://bugs.kde.org/show_bug.cgi?id=345750
> 
> 
> Repository: kunitconversion
> 
> 
> Description
> -------
> 
> QNetworkReply does not implement waitForReadyRead
> 
> Also, the code never actually created the cache dir it was trying to create a file in.
> 
> 
> Diffs
> -----
> 
>   src/currency.cpp 3b99644 
> 
> Diff: https://git.reviewboard.kde.org/r/127251/diff/
> 
> 
> Testing
> -------
> 
> Works now. It's downloaded once and then taken from cache file in ~/.local/share/libkunitconversion/currency.xml
> 
> Given it's a Tier 2 framework doesn't make sense to add KIO now, also failed to reproduce the crashes mentioned in the code.
> 
> Tests pass (only if I run them on English locale btw)
> 
> Obviously not happy with this being sync but alas that's how the API works.
> 
> Not sure if this is a KRunner bug or KUnitConverison but if I enter "5 USD" it converts fine, if I enter "5 usd" it returns zero for all the currencies it converted to.
> 
> 
> Thanks,
> 
> Kai Uwe Broulik
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160305/bbf384a3/attachment.html>


More information about the Kde-frameworks-devel mailing list