remove eventual existing row wit the key before inserting a new row
svn path=/trunk/KDE/kdelibs/; revision=1181670
This commit is contained in:
parent
b0472dc212
commit
876b399640
@ -59,6 +59,10 @@ void StorageJob::start()
|
||||
|
||||
if (operationName() == "save") {
|
||||
QSqlQuery query(m_db);
|
||||
query.prepare("delete from data where key = :id");
|
||||
query.bindValue(":id", params["key"].toString());
|
||||
query.exec();
|
||||
|
||||
query.prepare("insert into data values(:id, :source, :datavalue, 'now')");
|
||||
query.bindValue(":id", params["key"].toString());
|
||||
query.bindValue(":source", params["source"].toString());
|
||||
|
Loading…
Reference in New Issue
Block a user