1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[DatabasePasswordBackend] Make tests from previous commit pass.

This commit is contained in:
nowrep 2013-05-21 13:37:58 +02:00
parent f8c5415a1b
commit c54031793e

View File

@ -102,8 +102,7 @@ void DatabasePasswordBackend::addEntry(const PasswordEntry &entry)
query.bindValue(1, entry.data); query.bindValue(1, entry.data);
query.bindValue(2, entry.username); query.bindValue(2, entry.username);
query.bindValue(3, entry.password); query.bindValue(3, entry.password);
query.exec();
mApp->dbWriter()->executeQuery(query);
} }
void DatabasePasswordBackend::updateEntry(const PasswordEntry &entry) void DatabasePasswordBackend::updateEntry(const PasswordEntry &entry)
@ -125,7 +124,7 @@ void DatabasePasswordBackend::updateEntry(const PasswordEntry &entry)
query.addBindValue(entry.id); query.addBindValue(entry.id);
} }
mApp->dbWriter()->executeQuery(query); query.exec();
} }
void DatabasePasswordBackend::updateLastUsed(PasswordEntry &entry) void DatabasePasswordBackend::updateLastUsed(PasswordEntry &entry)
@ -133,8 +132,7 @@ void DatabasePasswordBackend::updateLastUsed(PasswordEntry &entry)
QSqlQuery query; QSqlQuery query;
query.prepare("UPDATE autofill SET last_used=strftime('%s', 'now') WHERE id=?"); query.prepare("UPDATE autofill SET last_used=strftime('%s', 'now') WHERE id=?");
query.addBindValue(entry.id); query.addBindValue(entry.id);
query.exec();
mApp->dbWriter()->executeQuery(query);
} }
void DatabasePasswordBackend::removeEntry(const PasswordEntry &entry) void DatabasePasswordBackend::removeEntry(const PasswordEntry &entry)
@ -142,14 +140,12 @@ void DatabasePasswordBackend::removeEntry(const PasswordEntry &entry)
QSqlQuery query; QSqlQuery query;
query.prepare("DELETE FROM autofill WHERE id=?"); query.prepare("DELETE FROM autofill WHERE id=?");
query.addBindValue(entry.id); query.addBindValue(entry.id);
query.exec();
mApp->dbWriter()->executeQuery(query);
} }
void DatabasePasswordBackend::removeAll() void DatabasePasswordBackend::removeAll()
{ {
QSqlQuery query; QSqlQuery query;
query.prepare("DELETE FROM autofill"); query.prepare("DELETE FROM autofill");
query.exec();
mApp->dbWriter()->executeQuery(query);
} }