diff options
author | Minijackson <minijackson@riseup.net> | 2018-07-19 10:08:39 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-07-19 10:08:39 +0200 |
commit | 0e54657272477ad779cc5c0e3f843b9f01b5e928 (patch) | |
tree | 886d026d9de3bd83fcf2656fafa36ad5a9e64268 /common/storage/key.h | |
parent | 27a408876e179d62dc25050a6f386bf2d9b80a9b (diff) | |
download | sink-0e54657272477ad779cc5c0e3f843b9f01b5e928.tar.gz sink-0e54657272477ad779cc5c0e3f843b9f01b5e928.zip |
Default constructor of Identifier produces null + safety net
Diffstat (limited to 'common/storage/key.h')
-rw-r--r-- | common/storage/key.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/common/storage/key.h b/common/storage/key.h index 40f4aca..151c333 100644 --- a/common/storage/key.h +++ b/common/storage/key.h | |||
@@ -37,7 +37,8 @@ public: | |||
37 | static const constexpr size_t INTERNAL_REPR_SIZE = 16; | 37 | static const constexpr size_t INTERNAL_REPR_SIZE = 16; |
38 | static const constexpr size_t DISPLAY_REPR_SIZE = 38; | 38 | static const constexpr size_t DISPLAY_REPR_SIZE = 38; |
39 | 39 | ||
40 | Identifier() : uid(QUuid::createUuid()){}; | 40 | Identifier() = default; |
41 | static Identifier createIdentifier(); | ||
41 | 42 | ||
42 | QByteArray toInternalByteArray() const; | 43 | QByteArray toInternalByteArray() const; |
43 | static Identifier fromInternalByteArray(const QByteArray &bytes); | 44 | static Identifier fromInternalByteArray(const QByteArray &bytes); |
@@ -76,8 +77,6 @@ public: | |||
76 | static const constexpr size_t INTERNAL_REPR_SIZE = Identifier::INTERNAL_REPR_SIZE + Revision::INTERNAL_REPR_SIZE; | 77 | static const constexpr size_t INTERNAL_REPR_SIZE = Identifier::INTERNAL_REPR_SIZE + Revision::INTERNAL_REPR_SIZE; |
77 | static const constexpr size_t DISPLAY_REPR_SIZE = Identifier::DISPLAY_REPR_SIZE + Revision::DISPLAY_REPR_SIZE; | 78 | static const constexpr size_t DISPLAY_REPR_SIZE = Identifier::DISPLAY_REPR_SIZE + Revision::DISPLAY_REPR_SIZE; |
78 | 79 | ||
79 | // Just to be able to store keys into Qt containers | ||
80 | [[deprecated("Don't use the default constructor")]] | ||
81 | Key() : id(), rev(0) {} | 80 | Key() : id(), rev(0) {} |
82 | Key(const Identifier &id, const Revision &rev) : id(id), rev(rev) {} | 81 | Key(const Identifier &id, const Revision &rev) : id(id), rev(rev) {} |
83 | 82 | ||