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:
parent
85ee69f008
commit
6c9f77530e
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user