Port from QDom to QXmlStreamReader
ClosedPublic

Authored by broulik on Nov 23 2017, 3:59 PM.

Details

Summary

The Qt Xml module is not actively maintained anymore and docs suggest to use QXmlStreamReader. Also removes the dependency on Qt Xml

Test Plan

I can still convert currencies just fine. When the XML file is corrupt, it tries to read it again. It does not try to re-download it, though, but that has been an issue before too (it only checks exists && mtime)

ValueTest fails

FAIL!  : ValueTest::testCurrencyNotDownloaded() '!eur.isValid()' returned FALSE. ()

but this is also without this patch and might be an issue when running it locally (it fails even worse if run with locale != en)

Diff Detail

Repository
R292 KUnitConversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Nov 23 2017, 3:59 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 23 2017, 3:59 PM
anthonyfieroni added inline comments.
src/currency.cpp
713

To compare double to int is never good idea, it can be even worst when compared it to double :)
So to be precise as well it should be

if (multiplier > std::numeric_limits<double>::epsilon())

qFuzzyIsNull rather. The original code didn't even check ..

broulik updated this revision to Diff 22874.Nov 24 2017, 9:36 AM
  • Use qFuzzyIsNull
dfaure accepted this revision.Dec 2 2017, 4:37 PM
This revision is now accepted and ready to land.Dec 2 2017, 4:37 PM
This revision was automatically updated to reflect the committed changes.