diff options
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r-- | common/typeindex.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp index b8845b7..113c209 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp | |||
@@ -21,16 +21,16 @@ | |||
21 | #include "log.h" | 21 | #include "log.h" |
22 | #include "index.h" | 22 | #include "index.h" |
23 | #include <QDateTime> | 23 | #include <QDateTime> |
24 | #include <QDataStream> | ||
24 | 25 | ||
25 | using namespace Sink; | 26 | using namespace Sink; |
26 | 27 | ||
27 | static QByteArray getByteArray(const QVariant &value) | 28 | static QByteArray getByteArray(const QVariant &value) |
28 | { | 29 | { |
29 | if (value.type() == QVariant::DateTime) { | 30 | if (value.type() == QVariant::DateTime) { |
30 | const auto result = value.toDateTime().toString().toLatin1(); | 31 | QByteArray result; |
31 | if (result.isEmpty()) { | 32 | QDataStream ds(&result, QIODevice::WriteOnly); |
32 | return "nodate"; | 33 | ds << value.toDateTime(); |
33 | } | ||
34 | return result; | 34 | return result; |
35 | } | 35 | } |
36 | if (value.type() == QVariant::Bool) { | 36 | if (value.type() == QVariant::Bool) { |