X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=949306b8faae2433ec7dc92862074596155d0029;hp=64bfbbc784860e4993807a1977ac67eea873566c;hb=0c9cd0eef379e1d3e10a75cc8506a7e65f95fd67;hpb=e733408e4759473bf38831f498f48a0f2f5e6dc7 diff --git a/src/common/types.h b/src/common/types.h index 64bfbbc7..949306b8 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -32,6 +32,7 @@ class SignedId { public: inline SignedId(int _id = 0) { id = _id; } inline qint32 toInt() const { return id; } + inline bool isValid() const { return id > 0; } inline bool operator==(const SignedId &other) const { return id == other.id; } inline bool operator!=(const SignedId &other) const { return id != other.id; } @@ -78,11 +79,16 @@ struct IdentityId : public SignedId { //inline operator QVariant() const { return QVariant::fromValue(*this); } }; +struct AccountId : public SignedId { + inline AccountId(int _id = 0) : SignedId(_id) {}; +}; + Q_DECLARE_METATYPE(UserId); Q_DECLARE_METATYPE(MsgId); Q_DECLARE_METATYPE(BufferId); Q_DECLARE_METATYPE(NetworkId); Q_DECLARE_METATYPE(IdentityId); +Q_DECLARE_METATYPE(AccountId); //! Base class for exceptions. struct Exception {