diff --git a/include/RecentResourceListModel.h b/include/RecentResourceListModel.h index 1d886c916..00cc1b639 100644 --- a/include/RecentResourceListModel.h +++ b/include/RecentResourceListModel.h @@ -50,6 +50,8 @@ public: return m_model; } + ResourceItem * item( const QModelIndex & _idx ); + protected: // compares items at two indices by date-property diff --git a/src/core/RecentResourceListModel.cpp b/src/core/RecentResourceListModel.cpp index c87095361..92cfd92ed 100644 --- a/src/core/RecentResourceListModel.cpp +++ b/src/core/RecentResourceListModel.cpp @@ -39,7 +39,16 @@ RecentResourceListModel::RecentResourceListModel( ResourceDB * _db, -bool RecentResourceListModel::lessThan ( const QModelIndex & _left, + +ResourceItem * RecentResourceListModel::item( const QModelIndex & _idx ) +{ + return m_model->item( mapToSource( _idx ) ); +} + + + + +bool RecentResourceListModel::lessThan( const QModelIndex & _left, const QModelIndex & _right ) const { return m_model->item( _left )->lastMod() < m_model->item( _right )->lastMod();