mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
Utility functions to sort text messages by timestamp (ascending/descending)
* compare function for text message * resort function * text message edit can display HTML text messages with ascending/descending timestamp * made CTextMessageListModel -> CListModelTimestampObject
This commit is contained in:
committed by
Mat Sutcliffe
parent
25eb13a83f
commit
e12dc3a73a
@@ -107,8 +107,8 @@ namespace BlackGui
|
||||
|
||||
Q_UNUSED(sort);
|
||||
ModelClass *model = this->derivedModel();
|
||||
auto sortColumn = model->getSortColumn();
|
||||
auto sortOrder = model->getSortOrder();
|
||||
const auto sortColumn = model->getSortColumn();
|
||||
const auto sortOrder = model->getSortOrder();
|
||||
this->showLoadIndicator(container.size());
|
||||
CWorker *worker = CWorker::fromTask(this, "ViewSort", [model, container, sortColumn, sortOrder]()
|
||||
{
|
||||
@@ -300,7 +300,7 @@ namespace BlackGui
|
||||
if (!hasSelection()) { return 0; }
|
||||
int c = 0;
|
||||
|
||||
int lastUpdatedRow = -1;
|
||||
int lastUpdatedRow = -1;
|
||||
int firstUpdatedRow = -1;
|
||||
const CPropertyIndexList propertyIndexes(vm.indexes());
|
||||
const QModelIndexList indexes = this->selectedRows();
|
||||
@@ -503,6 +503,18 @@ namespace BlackGui
|
||||
m_model->sortByPropertyIndex(propertyIndex, order);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void CViewBase<T>::sort()
|
||||
{
|
||||
m_model->sort();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void CViewBase<T>::resort()
|
||||
{
|
||||
m_model->resort();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
QJsonObject CViewBase<T>::toJson(bool selectedOnly) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user