MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / AddKey

Method AddKey

Src/Database/DatabaseFilter.cpp:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43int CDatabaseFilter::AddKey(const QString &szKey)
44{
45
46 if(contains(szKey)) return false;
47
48 QSqlQuery query(GetDatabase());
49 query.prepare(
50 "INSERT INTO " + m_szTableName + " (`key`) VALUES (:key) "
51 );
52 query.bindValue(":key", szKey);
53 bool bRet = query.exec();
54
55 if (!bRet) {
56 qCritical(log) << "Failed to add key[" + szKey + "]:"
57 << query.lastError().text()
58 << "Sql:" << query.executedQuery();
59 return -1;
60 }
61 return 0;
62}
63
64int CDatabaseFilter::RemoveKey(const QString &szKey)
65{

Callers 1

AcceptMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected