diff --git a/src/libtomahawk/playlist/RecentlyPlayedModel.cpp b/src/libtomahawk/playlist/RecentlyPlayedModel.cpp index 0336790fb..3f63b83a3 100644 --- a/src/libtomahawk/playlist/RecentlyPlayedModel.cpp +++ b/src/libtomahawk/playlist/RecentlyPlayedModel.cpp @@ -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, QList ) ), @@ -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(); +} diff --git a/src/libtomahawk/playlist/RecentlyPlayedModel.h b/src/libtomahawk/playlist/RecentlyPlayedModel.h index c3a66eae1..1ac3d6a05 100644 --- a/src/libtomahawk/playlist/RecentlyPlayedModel.h +++ b/src/libtomahawk/playlist/RecentlyPlayedModel.h @@ -20,6 +20,7 @@ #define RECENTLYPLAYEDMODEL_H #include +#include #include #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