diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-31 15:07:12 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-31 15:07:12 +0200 |
commit | 4798de83c9f198bfc0a802a987c9002968fb6c2c (patch) | |
tree | 74412b79d0ca0c269ef2986d225a4eb71f6ec596 /common/storage_common.cpp | |
parent | f90ca753a4b723dbf72996bbd1261dc786c7cce6 (diff) | |
download | sink-4798de83c9f198bfc0a802a987c9002968fb6c2c.tar.gz sink-4798de83c9f198bfc0a802a987c9002968fb6c2c.zip |
Fixed revision sorting
We used to sort wrong as soon as we got over revision 9.
Diffstat (limited to 'common/storage_common.cpp')
-rw-r--r-- | common/storage_common.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/storage_common.cpp b/common/storage_common.cpp index 0b9d324..4ca484a 100644 --- a/common/storage_common.cpp +++ b/common/storage_common.cpp | |||
@@ -153,8 +153,9 @@ bool Storage::isInternalKey(const QByteArray &key) | |||
153 | 153 | ||
154 | QByteArray Storage::assembleKey(const QByteArray &key, qint64 revision) | 154 | QByteArray Storage::assembleKey(const QByteArray &key, qint64 revision) |
155 | { | 155 | { |
156 | Q_ASSERT(revision <= 9999); | ||
156 | Q_ASSERT(key.size() == 38); | 157 | Q_ASSERT(key.size() == 38); |
157 | return key + QByteArray::number(revision); | 158 | return key + QByteArray::number(revision).rightJustified(4, '0', false); |
158 | } | 159 | } |
159 | 160 | ||
160 | QByteArray Storage::uidFromKey(const QByteArray &key) | 161 | QByteArray Storage::uidFromKey(const QByteArray &key) |