diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-08-31 18:30:42 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-08-31 18:30:42 +0900 |
commit | b1b23e3500ff80d62b54153341e66fdfef4534db (patch) | |
tree | e512ce11ba2c5bad32e42a74a105fb4758fc0f73 /events/event.h | |
parent | 0fe83d59d76cd8f9c8f92d40cc58d9f5b082a84a (diff) | |
download | libquotient-b1b23e3500ff80d62b54153341e66fdfef4534db.tar.gz libquotient-b1b23e3500ff80d62b54153341e66fdfef4534db.zip |
QList<Event*> -> using Events=QVector<Event*>
Diffstat (limited to 'events/event.h')
-rw-r--r-- | events/event.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/events/event.h b/events/event.h index 72d26208..d9316747 100644 --- a/events/event.h +++ b/events/event.h @@ -24,6 +24,7 @@ #include <QtCore/QString> #include <QtCore/QDateTime> #include <QtCore/QJsonObject> +#include <QtCore/QVector> class QJsonArray; @@ -38,7 +39,8 @@ namespace QMatrixClient class Event { public: - Event(EventType type); + explicit Event(EventType type); + Event(Event&) = delete; virtual ~Event(); EventType type() const; @@ -57,8 +59,9 @@ namespace QMatrixClient class Private; Private* d; }; + using Events = QVector<Event*>; - QList<Event*> eventListFromJson(const QJsonArray& contents); + Events eventsFromJson(const QJsonArray& contents); /** * Finds a place in the timeline where a new event/message could be inserted. @@ -71,6 +74,11 @@ namespace QMatrixClient { return std::lower_bound (timeline.begin(), timeline.end(), item, [](const typename ContT::value_type a, const ItemT * b) { + // FIXME: We should not order the message list by origin timestamp. + // Rather, an order of receiving should be used (which actually + // poses a question on whether this method is needed at all - + // or we'd just prepend and append, depending on whether we + // received something from /sync or from /messages. return a->timestamp() < b->timestamp(); } ); |