mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
Merge pull request #1457 from csoler/v0.6-ImprovedGUI
fixed sorting of last time used in keyring
This commit is contained in:
commit
343ccaa1c5
@ -144,7 +144,7 @@ QVariant pgpid_item_model::data(const QModelIndex &index, int role) const
|
||||
if (!rsPeers->getGPGDetails(*it, detail))
|
||||
return QVariant();
|
||||
//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())
|
||||
{
|
||||
|
@ -22,6 +22,7 @@
|
||||
#define PGPID_ITEM_PROXY_H
|
||||
|
||||
#include "util/cxx11retrocompat.h"
|
||||
#include "pgpid_item_model.h"
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
@ -36,7 +37,10 @@ public:
|
||||
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
|
||||
{
|
||||
return left.data(Qt::DisplayRole).toString().toUpper() < right.data(Qt::DisplayRole).toString().toUpper();
|
||||
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();
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
Loading…
Reference in New Issue
Block a user