/***************************************************************************
- * Copyright (C) 2005-07 by the Quassel IRC Team *
+ * Copyright (C) 2005-07 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <QtSql>
-#include "network.h"
-
-#include "util.h"
#include "logger.h"
+#include "network.h"
+#include "quassel.h"
int SqliteStorage::_maxRetryCount = 150; // yes this is a large number... only other way to "handle" this is bailing out...
return messagelist;
QSqlQuery query(logDb());
- if(last == -1) {
- query.prepare(queryString("select_messagesNew"));
+
+ if(last == -1 && first == -1) {
+ query.prepare(queryString("select_messagesNewestK"));
+ } else if(last == -1) {
+ query.prepare(queryString("select_messagesNewerThan"));
+ query.bindValue(":firstmsg", first.toInt());
} else {
query.prepare(queryString("select_messages"));
query.bindValue(":lastmsg", last.toInt());
+ query.bindValue(":firstmsg", first.toInt());
}
query.bindValue(":bufferid", bufferId.toInt());
- query.bindValue(":firstmsg", first.toInt());
query.bindValue(":limit", limit);
safeExec(query);
}
QString SqliteStorage::backlogFile() {
- return quasselDir().absolutePath() + "/quassel-storage.sqlite";
+ return Quassel::configDirPath() + "quassel-storage.sqlite";
}
bool SqliteStorage::safeExec(QSqlQuery &query, int retryCount) {