src/EditRecipe.cpp

changeset 165
c8e6ab63d671
parent 163
6cccd340ea8c
child 169
541ddf3edb10
equal deleted inserted replaced
164:47ee0d1b47e9 165:c8e6ab63d671
1091 tr("MySQL error: %1\n%2\n%3") 1091 tr("MySQL error: %1\n%2\n%3")
1092 .arg(query.lastError().nativeErrorCode()) 1092 .arg(query.lastError().nativeErrorCode())
1093 .arg(query.lastError().driverText()) 1093 .arg(query.lastError().driverText())
1094 .arg(query.lastError().databaseText())); 1094 .arg(query.lastError().databaseText()));
1095 } else { 1095 } else {
1096 qDebug() << "EditRecipe Saved"; 1096 /*
1097 * If this was a new recipe, find out what record number we
1098 * have got and set it. So when the user saves this record
1099 * again, it will be updated instead of inserting a new copy.
1100 */
1101 if (this->recno < 0) {
1102 QVariant id = query.lastInsertId();
1103 this->recno = recipe->record = id.toInt();
1104 qDebug() << "EditRecipe Inserted record" << this->recno;
1105 } else {
1106 qDebug() << "EditRecipe Updated record" << this->recno;
1107 }
1097 } 1108 }
1098 } 1109 }
1099 1110
1100 ui->saveButton->setEnabled(false); 1111 ui->saveButton->setEnabled(false);
1101 this->textIsChanged = false; 1112 this->textIsChanged = false;

mercurial