mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed sorting of last time used in keyring
This commit is contained in:
parent
b7340ef7ee
commit
266edf06aa
@ -144,7 +144,7 @@ QVariant pgpid_item_model::data(const QModelIndex &index, int role) const
|
|||||||
if (!rsPeers->getGPGDetails(*it, detail))
|
if (!rsPeers->getGPGDetails(*it, detail))
|
||||||
return QVariant();
|
return QVariant();
|
||||||
//shit code end
|
//shit code end
|
||||||
if(role == Qt::EditRole) //some columns return raw data for editrole, used for proper filtering
|
if(role == Qt::EditRole) //some columns return raw data for editrole, used for proper filtering and sorting
|
||||||
{
|
{
|
||||||
switch(index.column())
|
switch(index.column())
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#define PGPID_ITEM_PROXY_H
|
#define PGPID_ITEM_PROXY_H
|
||||||
|
|
||||||
#include "util/cxx11retrocompat.h"
|
#include "util/cxx11retrocompat.h"
|
||||||
|
#include "pgpid_item_model.h"
|
||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
@ -36,6 +37,9 @@ public:
|
|||||||
|
|
||||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
|
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
|
||||||
{
|
{
|
||||||
|
if(left.column() == COLUMN_LAST_USED)
|
||||||
|
return left.data(Qt::EditRole).toUInt() < right.data(Qt::EditRole).toUInt();
|
||||||
|
else
|
||||||
return left.data(Qt::DisplayRole).toString().toUpper() < right.data(Qt::DisplayRole).toString().toUpper();
|
return left.data(Qt::DisplayRole).toString().toUpper() < right.data(Qt::DisplayRole).toString().toUpper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user