X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.h;h=d0046a9f150eb5037ec34176fa1e2fb8b73ba0fb;hp=2894291383fba787df362b492acfbbfd266cd57b;hb=ecf6e74621aad76c35e67a0df3faafd994fce9dc;hpb=5e5714fb2abf8feaf9cc4a27a26e86f2f9c45b30 diff --git a/src/core/abstractsqlstorage.h b/src/core/abstractsqlstorage.h index 28942913..d0046a9f 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(); @@ -79,8 +89,9 @@ private: void addConnectionToPool(); int _schemaVersion; + bool _debug; - 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 +132,7 @@ public: struct SenderMO { int senderId; QString sender; + SenderMO() : senderId(0) {} }; struct IdentityMO { @@ -176,6 +188,9 @@ public: QString awaymessage; QString attachperform; QString detachperform; + bool usesasl; + QString saslaccount; + QString saslpassword; }; struct BufferMO { @@ -187,6 +202,7 @@ public: QString buffercname; int buffertype; int lastseenmsgid; + int markerlinemsgid; QString key; bool joined; }; @@ -269,11 +285,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 +308,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;