Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
trinity/include/roomlistsortmodel.h
Joshua Goins a825c8886d Add basic encryption support
Sorry this is a huge commit, this actually includes a ton
of stuff. Text color is now readable, multiple accounts
are supported alongside end-to-end encryption but no
cross-signing yet :-) There's also a whole lot of other
small changes, such as choosing the server you want to
request a room directory from.
2022-03-01 16:20:32 -05:00

38 lines
984 B
C++
Executable file

#pragma once
#include <QSortFilterProxyModel>
class RoomListSortModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
Q_INVOKABLE unsigned int getOriginalIndex(const unsigned int i) const {
auto const proxyIndex = index(i, 0);
auto const sourceIndex = mapToSource(proxyIndex);
if(!sourceIndex.isValid())
return 0;
else
return sourceIndex.row();
}
};
class MemberListSortModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
Q_INVOKABLE unsigned int getOriginalIndex(const unsigned int i) const {
auto const proxyIndex = index(i, 0);
auto const sourceIndex = mapToSource(proxyIndex);
if(!sourceIndex.isValid())
return 0;
else
return sourceIndex.row();
}
};