Wed, 18 Jan 2023 17:08:25 +0100
Added fields for filename and timestamp.
src/EditProductTab13.cpp | file | annotate | diff | comparison | revisions |
--- a/src/EditProductTab13.cpp Wed Jan 18 16:17:31 2023 +0100 +++ b/src/EditProductTab13.cpp Wed Jan 18 17:08:25 2023 +0100 @@ -128,11 +128,15 @@ } disconnect(buttonBox, nullptr, nullptr, nullptr); - query.prepare("INSERT INTO products_pics SET uuid=:uuid, pic_type=:pic_type, pic_data=:pic_data, pic_comment=:pic_comment"); + QFileInfo fi(fileName); + query.prepare("INSERT INTO products_pics SET uuid=:uuid, pic_type=:pic_type, pic_data=:pic_data, " + "pic_comment=:pic_comment, filename=:filename, timestamp=:timestamp"); query.bindValue(":uuid", product->uuid); query.bindValue(":pic_type", g_prod_pic_types[typeEdit->currentIndex()]); query.bindValue(":pic_data", imageByteArray); query.bindValue(":pic_comment", commentEdit->text()); + query.bindValue(":filename", fi.fileName()); + query.bindValue(":timestamp", fi.lastModified()); query.exec(); if (query.lastError().isValid()) {