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/src/roomlistsortmodel.cpp

18 lines
511 B
C++
Raw Normal View History

2021-07-21 16:08:15 -04:00
#include "roomlistsortmodel.h"
#include "room.h"
#include "roomlistmodel.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;
}