diff options
| author | Alexander Golubev <fatzer2@gmail.com> | 2025-08-03 02:34:04 +0300 |
|---|---|---|
| committer | Alexander Golubev <fatzer2@gmail.com> | 2025-08-04 03:34:06 +0300 |
| commit | 7b2d5032f9573eaafa300a3159971e37125fd2d9 (patch) | |
| tree | 3c607af6e7b30df63665f1ff6a950cd559152fb0 /src/importers/recipemlimporter.cpp | |
| parent | 84991f49a0ab963597b697d99e9f3c1c6c9053ee (diff) | |
| download | krecipes-7b2d5032.tar.gz krecipes-7b2d5032.zip | |
Use locale-unaware functions when importing files
Locale-aware version of MixedNumber::fromString() were causing problems
when locale has a different decimal separator than dot (`.`).
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit adf2fa32500d33417b6e6ac9e2867f3ab3eede34)
Diffstat (limited to 'src/importers/recipemlimporter.cpp')
| -rw-r--r-- | src/importers/recipemlimporter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/importers/recipemlimporter.cpp b/src/importers/recipemlimporter.cpp index 8866648..c5fa51a 100644 --- a/src/importers/recipemlimporter.cpp +++ b/src/importers/recipemlimporter.cpp @@ -350,7 +350,7 @@ void RecipeMLImporter::readRecipemlTQty( const TQDomElement &qty, Ingredient &in if ( tagName == "range" ) readRecipemlRange( qtyChild, ing.amount, ing.amount_offset ); else if ( tagName.isEmpty() ) - ing.amount = MixedNumber::fromString( qty.text() ).toDouble(); + ing.amount = MixedNumber::fromString( qty.text(), nullptr, /* locale_aware= */ false ).toDouble(); else kdDebug() << "Unknown tag within <qty>: " << tagName << endl; } @@ -364,9 +364,9 @@ void RecipeMLImporter::readRecipemlRange( const TQDomElement& range, double &amo TQDomElement rangeChild = rangeChilds.item( j ).toElement(); TQString subTagName = rangeChild.tagName(); if ( subTagName == "q1" ) - q1 = MixedNumber::fromString( rangeChild.text() ).toDouble(); + q1 = MixedNumber::fromString( rangeChild.text(), nullptr, /* locale_aware= */ false ).toDouble(); else if ( subTagName == "q2" ) - q2 = MixedNumber::fromString( rangeChild.text() ).toDouble(); + q2 = MixedNumber::fromString( rangeChild.text(), nullptr, /* locale_aware= */ false ).toDouble(); else kdDebug() << "Unknown tag within <range>: " << subTagName << endl; } |
