Clear mash measurments when duplicating a product.

Tue, 05 Mar 2024 10:25:15 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 05 Mar 2024 10:25:15 +0100
changeset 521
5fbe71d69fe5
parent 520
9166c0b82ada
child 522
987bf1122d0d

Clear mash measurments when duplicating a product.

src/EditProductExport.cpp file | annotate | diff | comparison | revisions
src/database/db_product.cpp file | annotate | diff | comparison | revisions
translations/bmsapp_en.ts file | annotate | diff | comparison | revisions
translations/bmsapp_nl.ts file | annotate | diff | comparison | revisions
--- a/src/EditProductExport.cpp	Mon Mar 04 19:51:57 2024 +0100
+++ b/src/EditProductExport.cpp	Tue Mar 05 10:25:15 2024 +0100
@@ -312,6 +312,13 @@
     dup->divide_factor = 1;
     dup->log_brew = dup->log_fermentation = dup->log_ispindel = dup->log_co2pressure = dup->locked = 0;
     dup->prop_volume[0] = dup->prop_volume[1] = dup->prop_volume[2] = dup->prop_volume[3] = 0;
+    /*
+     * Reset measurement fields.
+     */
+    for (int i = 0; i < dup->mashs.size(); i++) {
+        dup->mashs[i].step_ph = 0;
+        dup->mashs[i].step_sg = 0;
+    }
 
     qDebug() << dup->record << dup->name;
     if (DB_product::save(dup, this)) {
--- a/src/database/db_product.cpp	Mon Mar 04 19:51:57 2024 +0100
+++ b/src/database/db_product.cpp	Tue Mar 05 10:25:15 2024 +0100
@@ -561,6 +561,7 @@
     }
 //    qDebug() << "mashs" << prod->mashs.size();
 
+    qInfo() << "loadProduct" << prod->record << "done";
     return true;
 }
 
--- a/translations/bmsapp_en.ts	Mon Mar 04 19:51:57 2024 +0100
+++ b/translations/bmsapp_en.ts	Tue Mar 05 10:25:15 2024 +0100
@@ -7690,8 +7690,8 @@
     <message>
         <location filename="../src/EditRecipeExport.cpp" line="270"/>
         <location filename="../src/EditRecipeExport.cpp" line="272"/>
-        <location filename="../src/EditRecipeExport.cpp" line="440"/>
-        <location filename="../src/EditRecipeExport.cpp" line="442"/>
+        <location filename="../src/EditRecipeExport.cpp" line="417"/>
+        <location filename="../src/EditRecipeExport.cpp" line="419"/>
         <source>Copy Recipe</source>
         <translation type="unfinished"></translation>
     </message>
@@ -7706,44 +7706,44 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="440"/>
+        <location filename="../src/EditRecipeExport.cpp" line="417"/>
         <source>Copy Recipe to Product ready.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="442"/>
+        <location filename="../src/EditRecipeExport.cpp" line="419"/>
         <source>Copy Recipe to Product error.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="579"/>
-        <location filename="../src/EditRecipeExport.cpp" line="613"/>
+        <location filename="../src/EditRecipeExport.cpp" line="556"/>
+        <location filename="../src/EditRecipeExport.cpp" line="590"/>
         <source>Export to forum</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="579"/>
+        <location filename="../src/EditRecipeExport.cpp" line="556"/>
         <source>The recipe and all data are copied to the clipboard.
 You can &quot;paste&quot; this data in the forum screen in your web browser.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="586"/>
+        <location filename="../src/EditRecipeExport.cpp" line="563"/>
         <source>Export choices</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="598"/>
+        <location filename="../src/EditRecipeExport.cpp" line="575"/>
         <source>Export to beerXML</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="603"/>
+        <location filename="../src/EditRecipeExport.cpp" line="580"/>
         <source>Copy to recipe</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="608"/>
+        <location filename="../src/EditRecipeExport.cpp" line="585"/>
         <source>Copy to product</source>
         <translation type="unfinished"></translation>
     </message>
@@ -12484,8 +12484,8 @@
         <location filename="../src/database/db_recipe.cpp" line="661"/>
         <location filename="../src/database/db_recipe.cpp" line="694"/>
         <location filename="../src/database/db_product.cpp" line="31"/>
-        <location filename="../src/database/db_product.cpp" line="1044"/>
-        <location filename="../src/database/db_product.cpp" line="1077"/>
+        <location filename="../src/database/db_product.cpp" line="1045"/>
+        <location filename="../src/database/db_product.cpp" line="1078"/>
         <source>Database error</source>
         <translation type="unfinished"></translation>
     </message>
@@ -12498,8 +12498,8 @@
     <message>
         <location filename="../src/database/db_recipe.cpp" line="662"/>
         <location filename="../src/database/db_recipe.cpp" line="695"/>
-        <location filename="../src/database/db_product.cpp" line="1045"/>
-        <location filename="../src/database/db_product.cpp" line="1078"/>
+        <location filename="../src/database/db_product.cpp" line="1046"/>
+        <location filename="../src/database/db_product.cpp" line="1079"/>
         <source>MySQL error: %1
 %2
 %3</source>
--- a/translations/bmsapp_nl.ts	Mon Mar 04 19:51:57 2024 +0100
+++ b/translations/bmsapp_nl.ts	Tue Mar 05 10:25:15 2024 +0100
@@ -8444,8 +8444,8 @@
     <message>
         <location filename="../src/EditRecipeExport.cpp" line="270"/>
         <location filename="../src/EditRecipeExport.cpp" line="272"/>
-        <location filename="../src/EditRecipeExport.cpp" line="440"/>
-        <location filename="../src/EditRecipeExport.cpp" line="442"/>
+        <location filename="../src/EditRecipeExport.cpp" line="417"/>
+        <location filename="../src/EditRecipeExport.cpp" line="419"/>
         <source>Copy Recipe</source>
         <translation>Kopieer Recept</translation>
     </message>
@@ -8460,45 +8460,45 @@
         <translation>Kopieer Recept fout.</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="440"/>
+        <location filename="../src/EditRecipeExport.cpp" line="417"/>
         <source>Copy Recipe to Product ready.</source>
         <translation>Kopieer Recept naar Product gereed.</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="442"/>
+        <location filename="../src/EditRecipeExport.cpp" line="419"/>
         <source>Copy Recipe to Product error.</source>
         <translation>Kopieer Recept naar Product fout.</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="579"/>
-        <location filename="../src/EditRecipeExport.cpp" line="613"/>
+        <location filename="../src/EditRecipeExport.cpp" line="556"/>
+        <location filename="../src/EditRecipeExport.cpp" line="590"/>
         <source>Export to forum</source>
         <translation>Exporteer naar Forum</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="579"/>
+        <location filename="../src/EditRecipeExport.cpp" line="556"/>
         <source>The recipe and all data are copied to the clipboard.
 You can &quot;paste&quot; this data in the forum screen in your web browser.</source>
         <translation>Het recept en alle gegevens zijn gekopieerd naar het klemboard.
 Je kunt deze gegevens &quot;plakken&quot; in het forum scherm in je web browser.</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="586"/>
+        <location filename="../src/EditRecipeExport.cpp" line="563"/>
         <source>Export choices</source>
         <translation>Export keuzes</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="598"/>
+        <location filename="../src/EditRecipeExport.cpp" line="575"/>
         <source>Export to beerXML</source>
         <translation>Exporteer naar beerXML</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="603"/>
+        <location filename="../src/EditRecipeExport.cpp" line="580"/>
         <source>Copy to recipe</source>
         <translation>Kopieer naar Recept</translation>
     </message>
     <message>
-        <location filename="../src/EditRecipeExport.cpp" line="608"/>
+        <location filename="../src/EditRecipeExport.cpp" line="585"/>
         <source>Copy to product</source>
         <translation>Kopieer naar Product</translation>
     </message>
@@ -14176,8 +14176,8 @@
         <location filename="../src/database/db_recipe.cpp" line="661"/>
         <location filename="../src/database/db_recipe.cpp" line="694"/>
         <location filename="../src/database/db_product.cpp" line="31"/>
-        <location filename="../src/database/db_product.cpp" line="1044"/>
-        <location filename="../src/database/db_product.cpp" line="1077"/>
+        <location filename="../src/database/db_product.cpp" line="1045"/>
+        <location filename="../src/database/db_product.cpp" line="1078"/>
         <source>Database error</source>
         <translation>Database fout</translation>
     </message>
@@ -14190,8 +14190,8 @@
     <message>
         <location filename="../src/database/db_recipe.cpp" line="662"/>
         <location filename="../src/database/db_recipe.cpp" line="695"/>
-        <location filename="../src/database/db_product.cpp" line="1045"/>
-        <location filename="../src/database/db_product.cpp" line="1078"/>
+        <location filename="../src/database/db_product.cpp" line="1046"/>
+        <location filename="../src/database/db_product.cpp" line="1079"/>
         <source>MySQL error: %1
 %2
 %3</source>

mercurial