#include "sqlitestorage.h"
-#include <QtSql>
+#include <QByteArray>
+#include <QDataStream>
+#include <QLatin1String>
+#include <QVariant>
#include "network.h"
#include "quassel.h"
lockForWrite();
safeExec(query);
if (query.lastError().isValid()
- && query.lastError().nativeErrorCode() == "19") { // user already exists - sadly 19 seems to be the general constraint violation error...
+ && query.lastError().nativeErrorCode() == QLatin1String{"19"}) { // user already exists - sadly 19 seems to be the general constraint violation error...
db.rollback();
}
else {
error = query.lastError().isValid();
// unexepcted error occured (19 == constraint violation)
- if (error && query.lastError().nativeErrorCode() != "19") {
+ if (error && query.lastError().nativeErrorCode() != QLatin1String{"19"}) {
watchQuery(query);
}
else {
if (logMessageQuery.lastError().isValid()) {
// constraint violation - must be NOT NULL constraint - probably the sender is missing...
- if (logMessageQuery.lastError().nativeErrorCode() == "19") {
+ if (logMessageQuery.lastError().nativeErrorCode() == QLatin1String{"19"}) {
QSqlQuery addSenderQuery(db);
addSenderQuery.prepare(queryString("insert_sender"));
addSenderQuery.bindValue(":sender", msg.sender());
// SQLITE_BUSY 5 /* The database file is locked */
// SQLITE_LOCKED 6 /* A table in the database is locked */
- if (nativeErrorCode == "5" || nativeErrorCode == "6") {
+ if (nativeErrorCode == QLatin1String{"5"} || nativeErrorCode == QLatin1String{"6"}) {
if (retryCount < _maxRetryCount)
return safeExec(query, retryCount + 1);
}