/***************************************************************************
- * Copyright (C) 2005-07 by The Quassel Team *
+ * Copyright (C) 2005-08 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
+ * (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
SqliteStorage();
virtual ~SqliteStorage();
- static void init();
-
+ public slots:
/* General */
static bool isAvailable();
static QString displayName();
+ virtual bool setup(const QVariantMap &settings = QVariantMap());
+ virtual bool init(const QVariantMap &settings = QVariantMap());
// TODO: Add functions for configuring the backlog handling, i.e. defining auto-cleanup settings etc
virtual QList<Message> requestMsgs(BufferInfo buffer, QDateTime since, int offset = -1);
virtual QList<Message> requestMsgRange(BufferInfo buffer, int first, int last);
- public slots:
- //! This is just for importing the old file-based backlog */
- /** This slot needs to be implemented in the storage backends.
- * It should first prepare (delete?) the database, then call initBackLogOld(UserId id).
- * If the importing was successful, backLogEnabledOld will be true afterwards.
- */
- void importOldBacklog();
-
signals:
void bufferInfoUpdated(BufferInfo);
protected:
private:
- void initDb();
+ static QString backlogFile(bool createPath = false);
+
void createBuffer(UserId user, const QString &network, const QString &buffer);
bool watchQuery(QSqlQuery *query);
+
+ QSqlDatabase logDb;
+
QSqlQuery *logMessageQuery;
QSqlQuery *addSenderQuery;
QSqlQuery *getLastMessageIdQuery;
QSqlQuery *getBufferInfoQuery;
};
-
#endif