# HG changeset patch # User Michiel Broek # Date 1674058105 -3600 # Node ID 68ef2cc3e8d2b65e0727efaafa355efda11dbfd8 # Parent 8fc90936055244f0f9eb07d1faba1a851ef44ae6 Added fields for filename and timestamp. diff -r 8fc909360552 -r 68ef2cc3e8d2 src/EditProductTab13.cpp --- 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()) {