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.
35 lines
1.3 KiB
C++
Executable file
35 lines
1.3 KiB
C++
Executable file
#include "roomlistsortmodel.h"
|
|
|
|
#include "room.h"
|
|
#include "roomlistmodel.h"
|
|
#include "membermodel.h"
|
|
|
|
bool RoomListSortModel::lessThan(const QModelIndex& left, const QModelIndex& right) const {
|
|
const QString sectionLeft = sourceModel()->data(left, RoomListModel::SectionRole).toString();
|
|
const QString sectionRight = sourceModel()->data(right, RoomListModel::SectionRole).toString();
|
|
|
|
if(sectionRight == "Direct Chats")
|
|
return false;
|
|
|
|
if(sectionLeft == "Direct Chats")
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
bool MemberListSortModel::lessThan(const QModelIndex& left, const QModelIndex& right) const {
|
|
const QString sectionLeft = sourceModel()->data(left, MemberModel::SectionRole).toString();
|
|
const QString sectionRight = sourceModel()->data(right, MemberModel::SectionRole).toString();
|
|
|
|
if(sectionLeft == "Admin" && sectionRight == "Moderator")
|
|
return true;
|
|
else if(sectionLeft == "Moderator" && sectionRight == "User")
|
|
return true;
|
|
else if(sectionLeft == "Admin" && sectionRight == "User")
|
|
return true;
|
|
|
|
if(sectionLeft == sectionRight)
|
|
return sourceModel()->data(left, MemberModel::DisplayNameRole).toString() < sourceModel()->data(right, MemberModel::DisplayNameRole).toString();
|
|
|
|
return false;
|
|
}
|