X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fsqlitestorage.h;h=ca56cabf1380b29c3275af8012f172e488e84f33;hp=74efe5aba4a16a1b63819ac4fccd902b8a0fdb5e;hb=97d674034551438238c568e8b42efb08e1ba7354;hpb=849a08cae7c2e3c40c7da34c7cee1e10057f551e diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index 74efe5ab..ca56cabf 100644 --- a/src/core/sqlitestorage.h +++ b/src/core/sqlitestorage.h @@ -34,12 +34,12 @@ class SqliteStorage : public Storage { SqliteStorage(); virtual ~SqliteStorage(); - static void init(); - /* 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 +65,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 +91,4 @@ class SqliteStorage : public Storage { QSqlQuery *getBufferInfoQuery; }; - #endif