X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fsqlitestorage.h;h=0ab46825f5f3545baebd86f142b8fb5d17a5f5fe;hb=0b881e26eb5d741effae4a8096b319c9f5bcd462;hp=c8265d133aca0dd89da40c4566a9451442b5fd83;hpb=902c95728306e5ba115de84800fc8d5d239c9d62;p=quassel.git diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index c8265d13..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,22 +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; @@ -94,5 +92,4 @@ class SqliteStorage : public Storage { QSqlQuery *getBufferInfoQuery; }; - #endif