src/EditProductTab2.cpp

changeset 529
7c9fb24bcc07
parent 527
84091b9cb800
child 530
a4d5daae8389
equal deleted inserted replaced
528:50b057ae50aa 529:7c9fb24bcc07
57 57
58 58
59 void EditProduct::initEquipment() 59 void EditProduct::initEquipment()
60 { 60 {
61 QSqlQuery query; 61 QSqlQuery query;
62
63 /*
64 * First see if we need to upgrade HLT settings.
65 * Test for default settings, change if possible.
66 */
67 if (product->eq_HLT_volume == 20 && product->eq_HLT_deadspace == 2) {
68 query.prepare("SELECT name,HLT_volume,HLT_deadspace FROM inventory_equipments WHERE name=:name");
69 query.bindValue(":name", product->eq_name);
70 query.exec();
71 if (query.next()) {
72 product->eq_HLT_volume = query.value("HLT_volume").toDouble();
73 product->eq_HLT_deadspace = query.value("HLT_deadspace").toDouble();
74 qDebug() << " Update equipment HLT settings" << product->eq_HLT_volume << product->eq_HLT_deadspace;
75 is_changed();
76 }
77 }
62 78
63 ui->eq_selectEdit->addItem(""); 79 ui->eq_selectEdit->addItem("");
64 query.prepare("SELECT name FROM inventory_equipments ORDER BY name"); 80 query.prepare("SELECT name FROM inventory_equipments ORDER BY name");
65 query.exec(); 81 query.exec();
66 while (query.next()) { 82 while (query.next()) {

mercurial