X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsqlitestorage.h;h=0ab46825f5f3545baebd86f142b8fb5d17a5f5fe;hp=74efe5aba4a16a1b63819ac4fccd902b8a0fdb5e;hb=f6f6f3e368543f0a4dce1dae772f161d7e357064;hpb=b30780406eabbcfdc313721e961ef063ab06c8d4 diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index 74efe5ab..0ab46825 100644 --- a/src/core/sqlitestorage.h +++ b/src/core/sqlitestorage.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel Team * + * Copyright (C) 2005-07 by the Quassel IRC Team * * 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 * @@ -34,12 +34,13 @@ class SqliteStorage : public Storage { 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 @@ -65,23 +66,19 @@ class SqliteStorage : public Storage { virtual QList requestMsgs(BufferInfo buffer, QDateTime since, int offset = -1); virtual QList 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; @@ -95,5 +92,4 @@ class SqliteStorage : public Storage { QSqlQuery *getBufferInfoQuery; }; - #endif