X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.h;h=8990551348d60446695c94bdc77d63c34cb0e193;hb=580662426b8b734566b37de61deccf5b89970c6e;hp=2894291383fba787df362b492acfbbfd266cd57b;hpb=5e5714fb2abf8feaf9cc4a27a26e86f2f9c45b30;p=quassel.git diff --git a/src/core/abstractsqlstorage.h b/src/core/abstractsqlstorage.h index 28942913..89905513 100644 --- a/src/core/abstractsqlstorage.h +++ b/src/core/abstractsqlstorage.h @@ -72,6 +72,16 @@ protected: inline virtual QString userName() { return QString(); } inline virtual QString password() { return QString(); } + + //! Initialize db specific features on connect + /** This is called every time a connection to a specific SQL backend is established + * the default implementation does nothing. + * + * When reimplementing this method, don't use logDB() inside this function as + * this would cause as we're just about to initialize that DB connection. + */ + inline virtual void initDbSession(QSqlDatabase & /* db */) {} + private slots: void connectionDestroyed(); @@ -80,7 +90,7 @@ private: int _schemaVersion; - int _nextConnectionId; + static int _nextConnectionId; QMutex _connectionPoolMutex; // we let a Connection Object manage each actual db connection // those objects reside in the thread the connection belongs to @@ -121,6 +131,7 @@ public: struct SenderMO { int senderId; QString sender; + SenderMO() : senderId(0) {} }; struct IdentityMO { @@ -187,6 +198,7 @@ public: QString buffercname; int buffertype; int lastseenmsgid; + int markerlinemsgid; QString key; bool joined; }; @@ -269,11 +281,11 @@ public: AbstractSqlMigrationReader(); virtual bool readMo(QuasselUserMO &user) = 0; - virtual bool readMo(SenderMO &sender) = 0; virtual bool readMo(IdentityMO &identity) = 0; virtual bool readMo(IdentityNickMO &identityNick) = 0; virtual bool readMo(NetworkMO &network) = 0; virtual bool readMo(BufferMO &buffer) = 0; + virtual bool readMo(SenderMO &sender) = 0; virtual bool readMo(BacklogMO &backlog) = 0; virtual bool readMo(IrcServerMO &ircserver) = 0; virtual bool readMo(UserSettingMO &userSetting) = 0; @@ -292,11 +304,11 @@ private: class AbstractSqlMigrationWriter : public AbstractSqlMigrator { public: virtual bool writeMo(const QuasselUserMO &user) = 0; - virtual bool writeMo(const SenderMO &sender) = 0; virtual bool writeMo(const IdentityMO &identity) = 0; virtual bool writeMo(const IdentityNickMO &identityNick) = 0; virtual bool writeMo(const NetworkMO &network) = 0; virtual bool writeMo(const BufferMO &buffer) = 0; + virtual bool writeMo(const SenderMO &sender) = 0; virtual bool writeMo(const BacklogMO &backlog) = 0; virtual bool writeMo(const IrcServerMO &ircserver) = 0; virtual bool writeMo(const UserSettingMO &userSetting) = 0;