mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-31 01:50:47 +03:00
Use built-in sorting so that dynamic updates work
This commit is contained in:
parent
7e538851d6
commit
368e13fac3
2 changed files with 2 additions and 9 deletions
|
@ -125,11 +125,6 @@ ReadReceiptsProxy::ReadReceiptsProxy(QString event_id, QString room_id, QObject
|
|||
{
|
||||
setSourceModel(&model_);
|
||||
setSortRole(ReadReceiptsModel::RawTimestamp);
|
||||
}
|
||||
|
||||
bool
|
||||
ReadReceiptsProxy::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
|
||||
{
|
||||
// since we are sorting from greatest to least timestamp, return something that looks totally backwards!
|
||||
return source_left.data().toULongLong() > source_right.data().toULongLong();
|
||||
sort(0, Qt::DescendingOrder);
|
||||
setDynamicSortFilter(true);
|
||||
}
|
||||
|
|
|
@ -63,8 +63,6 @@ public:
|
|||
QString eventId() const { return event_id_; }
|
||||
QString roomId() const { return room_id_; }
|
||||
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
|
||||
|
||||
private:
|
||||
QString event_id_;
|
||||
QString room_id_;
|
||||
|
|
Loading…
Reference in a new issue