Bug 345750

Summary: The currency conversion doesn't show proper values
Product: [Plasma] krunner Reporter: Joan <aseques>
Component: converterAssignee: Vishesh Handa <me>
Status: RESOLVED FIXED    
Severity: normal CC: aaronhoneycutt, achilleas.k, cap601, chris.taylor, ct.gsk, demsking, dmzkrsk, email, g.guerin, jamb.t, kde, kramski, patrick.auernig, plusfabi, robert.munteanu, simgunz, tonatiuhmiramontes
Priority: NOR    
Version: 5.4.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
URL: http://picpaste.com/pics/unitconverter-iyVhPSuW.1427884575.png
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Joan 2015-04-01 10:45:51 UTC
The value returned for the sentence "1 eur" is the following:
1e-99 (CAD)
1e-99 (USD)
1e-99 (JPY)
1e-99 (GBP)

Reproducible: Always

Steps to Reproduce:
1. Search for "1 eur" in krunner
Comment 1 Jiehong 2015-04-09 12:58:27 UTC
I confirm this bug in Archlinux as well for plasma 5.2.2.

This issue also affects converting to euro.

Example when typing "1 yen":
1 Canadian dollar (CAD)
1 United States dollar (USD)
1 pound sterling (GBP)
1e+99 euros (EUR)

According to the documentation, the data is extracted from https://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html, but the values are simply rubbish.

Same problem as https://bugs.kde.org/show_bug.cgi?id=340819.
Comment 2 Vishesh Handa 2015-04-09 13:18:11 UTC
I know about this bug - https://git.reviewboard.kde.org/r/122183/

The patch is exposing some threading issues with KRunner and causing occasional crashes. Until I figure that out, I'm not too keen on pushing it.
Comment 3 Vishesh Handa 2015-04-09 13:19:26 UTC
*** Bug 340819 has been marked as a duplicate of this bug. ***
Comment 4 Jiehong 2015-05-04 08:36:05 UTC
Just for information, this is for krunner 5.9.0 (last checked). I doubt the plasma version is relevant.

Any ideas about what the difficulty of the threading issues?
Comment 5 Vishesh Handa 2015-06-06 17:18:37 UTC
(In reply to Jiehong from comment #4)
> 
> Any ideas about what the difficulty of the threading issues?

Reliably reproducing them is the first problem. It just happens sometimes. Anyway, I'll try to put this on my radar again and figure out what the problem is. This has been blocked for too long.
Comment 6 Gauthier 2015-10-20 14:30:43 UTC
I can confirm this bug too, reproducible always. Any progress on it?
Comment 7 Aaron Honeycutt 2015-11-13 22:39:02 UTC
*** Bug 350652 has been marked as a duplicate of this bug. ***
Comment 8 Kai Uwe Broulik 2016-02-06 18:39:27 UTC
*** Bug 357357 has been marked as a duplicate of this bug. ***
Comment 9 kramski 2016-03-28 17:12:38 UTC
Same here with krunner 5.6.0 on Arch.

I'm getting "0 Canadian dollars" etc. as the results for every currency conversion I try, no real values.
Comment 10 Robert Munteanu 2016-03-31 19:50:03 UTC
Also happens with Plasma 5.5.5.2 on openSUSE Tumbleweed x86_64. I always get the '0' result.
Comment 11 Kai Uwe Broulik 2016-05-12 08:57:21 UTC
Git commit db3a863c0592f8737b67138043bb35839f27159d by Kai Uwe Broulik.
Committed on 12/05/2016 at 08:57.
Pushed by broulik into branch 'master'.

Fix downloading currency exchange rates

QNetworkReply does not implement waitForReadyRead. Also, the code never actually
created the cache dir it was trying to create a file in. Moreover, use QSaveFile
to avoid saving a half-written file and improve the mutex usage as a nested
QEventLoop can easily lead to deadlocks.

REVIEW: 127251

M  +31   -23   src/currency.cpp

http://commits.kde.org/kunitconversion/db3a863c0592f8737b67138043bb35839f27159d
Comment 12 Joan 2016-07-01 11:42:00 UTC
Thanks a lot for this fix, it just landed on my kubuntu :D