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.
38 lines
984 B
C++
Executable file
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();
|
|
}
|
|
};
|
|
|