1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(rawdatabase): Small style refactor

This commit is contained in:
Diadlo 2016-09-13 00:20:18 +03:00
parent 85ee69f008
commit 6c9f77530e
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -534,31 +534,30 @@ void RawDatabase::process()
if (result == SQLITE_ROW && query.rowCallback) if (result == SQLITE_ROW && query.rowCallback)
{ {
QVector<QVariant> row; QVector<QVariant> row;
for (int i=0; i<column_count; ++i) for (int i = 0; i < column_count; ++i)
row += extractData(stmt, i); row += extractData(stmt, i);
query.rowCallback(row); query.rowCallback(row);
} }
} while (result == SQLITE_ROW); } while (result == SQLITE_ROW);
if (result == SQLITE_ERROR) if (result == SQLITE_DONE)
{ continue;
qWarning() << "Error executing query" << anonymizeQuery(query.query);
QString anonQuery = anonymizeQuery(query.query);
switch (result) {
case SQLITE_ERROR:
qWarning() << "Error executing query" << anonQuery;
goto cleanupStatements; goto cleanupStatements;
} case SQLITE_MISUSE:
else if (result == SQLITE_MISUSE) qWarning() << "Misuse executing query" << anonQuery;
{
qWarning() << "Misuse executing query" << anonymizeQuery(query.query);
goto cleanupStatements; goto cleanupStatements;
} case SQLITE_CONSTRAINT:
else if (result == SQLITE_CONSTRAINT) qWarning() << "Constraint error executing query" << anonQuery;
{
qWarning() << "Constraint error executing query" << anonymizeQuery(query.query);
goto cleanupStatements; goto cleanupStatements;
} default:
else if (result != SQLITE_DONE) qWarning() << "Unknown error" << result
{ << "executing query" << anonQuery;
qWarning() << "Unknown error"<<result<<"executing query" << anonymizeQuery(query.query);
goto cleanupStatements; goto cleanupStatements;
} }
} }