1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

* RecentlyPlayedModel can now deal with date ranges.

This commit is contained in:
Christian Muehlhaeuser 2013-06-08 10:20:24 +02:00
parent 99e331d8cd
commit 00de575744
2 changed files with 22 additions and 0 deletions

View File

@ -56,6 +56,8 @@ RecentlyPlayedModel::loadHistory()
startLoading();
DatabaseCommand_PlaybackHistory* cmd = new DatabaseCommand_PlaybackHistory( m_source );
cmd->setDateFrom( m_dateFrom );
cmd->setDateTo( m_dateTo );
cmd->setLimit( m_limit );
connect( cmd, SIGNAL( tracks( QList<Tomahawk::track_ptr>, QList<Tomahawk::PlaybackLog> ) ),
@ -150,3 +152,18 @@ RecentlyPlayedModel::isTemporary() const
{
return true;
}
void
RecentlyPlayedModel::setDateFrom( const QDate& date )
{
m_dateFrom = date;
}
void
RecentlyPlayedModel::setDateTo( const QDate& date )
{
m_dateTo = date;
loadHistory();
}

View File

@ -20,6 +20,7 @@
#define RECENTLYPLAYEDMODEL_H
#include <QList>
#include <QDate>
#include <QHash>
#include "Typedefs.h"
@ -42,6 +43,8 @@ public:
public slots:
void setSource( const Tomahawk::source_ptr& source );
void setDateFrom( const QDate& date );
void setDateTo( const QDate& date );
private slots:
void onSourcesReady();
@ -53,6 +56,8 @@ private slots:
private:
Tomahawk::source_ptr m_source;
unsigned int m_limit;
QDate m_dateFrom;
QDate m_dateTo;
};
#endif // RECENTLYPLAYEDMODEL_H