summaryrefslogtreecommitdiffstats
path: root/common/typeindex.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-20 20:49:17 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-20 20:49:17 +0100
commited42bdd74d70c7bcb9e1fb8f071ccb92b1515406 (patch)
treefc068b2f678d3d38d5ad398e6c85474306a0aa02 /common/typeindex.cpp
parentbc06643cd0c16140f6013be35b64732c1676e794 (diff)
downloadsink-ed42bdd74d70c7bcb9e1fb8f071ccb92b1515406.tar.gz
sink-ed42bdd74d70c7bcb9e1fb8f071ccb92b1515406.zip
Fetch more data on demand
We skip values we've already seen and only retrieve the new ones. This currently only properly works in a non-live query and we don't give the model any feedback when we can't fetch more data anymore. However, it generally works and we get the desired effect.
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r--common/typeindex.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index 3ee2492..ddf5df5 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -36,6 +36,10 @@ static QByteArray getByteArray(const QVariant &value)
36 36
37static QByteArray toSortableByteArray(const QDateTime &date) 37static QByteArray toSortableByteArray(const QDateTime &date)
38{ 38{
39 //Sort invalid last
40 if (!date.isValid()) {
41 return QByteArray::number(std::numeric_limits<unsigned int>::max());
42 }
39 return QByteArray::number(std::numeric_limits<unsigned int>::max() - date.toTime_t()); 43 return QByteArray::number(std::numeric_limits<unsigned int>::max() - date.toTime_t());
40} 44}
41 45