QSqlQuery query(db);
if (last == -1 && first == -1) {
query.prepare(queryString("select_messagesNewestK"));
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":bufferidDup1", bufferId.toInt());
}
else if (last == -1) {
query.prepare(queryString("select_messagesNewerThan"));
query.bindValue(":firstmsg", first.toQint64());
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":bufferidDup1", bufferId.toInt());
}
else {
query.prepare(queryString("select_messagesRange"));
query.bindValue(":lastmsg", last.toQint64());
query.bindValue(":firstmsg", first.toQint64());
+ // Workaround for Qt 4 QSqlQuery::bindValue() not needed, only has one ":bufferid"
}
query.bindValue(":bufferid", bufferId.toInt());
query.bindValue(":limit", limit);
QSqlQuery query(db);
if (last == -1 && first == -1) {
query.prepare(queryString("select_messagesNewestK_filtered"));
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":bufferidDup1", bufferId.toInt());
}
else if (last == -1) {
query.prepare(queryString("select_messagesNewerThan_filtered"));
query.bindValue(":firstmsg", first.toQint64());
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":bufferidDup1", bufferId.toInt());
}
else {
query.prepare(queryString("select_messagesRange_filtered"));
query.bindValue(":lastmsg", last.toQint64());
query.bindValue(":firstmsg", first.toQint64());
+ // Workaround for Qt 4 QSqlQuery::bindValue() not needed, only has one ":bufferid"
}
query.bindValue(":bufferid", bufferId.toInt());
query.bindValue(":limit", limit);
query.bindValue(":type", typeRaw);
int flagsRaw = flags;
query.bindValue(":flags", flagsRaw);
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":flagsDup1", flagsRaw);
safeExec(query);
watchQuery(query);
query.bindValue(":type", typeRaw);
int flagsRaw = flags;
query.bindValue(":flags", flagsRaw);
+ // Workaround for Qt 4 QSqlQuery::bindValue() not supporting repeated placeholder names
+ query.bindValue(":flagsDup1", flagsRaw);
safeExec(query);
watchQuery(query);