2
* Copyright (C) 2014 Canonical, Ltd.
5
* James Henstridge <james.henstridge@canonical.com>
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License version 3 as
9
* published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#include "SongsModel.hh"
22
using namespace mediascanner::qml;
24
SongsModel::SongsModel(QObject *parent)
25
: MediaFileModelBase(parent),
33
MediaStoreWrapper *SongsModel::getStore() {
37
void SongsModel::setStore(MediaStoreWrapper *store) {
38
if (this->store != store) {
44
QString SongsModel::getArtist() {
48
void SongsModel::setArtist(const QString artist) {
49
if (this->artist != artist) {
50
this->artist = artist;
55
QString SongsModel::getAlbum() {
59
void SongsModel::setAlbum(const QString album) {
60
if (this->album != album) {
66
QString SongsModel::getAlbumArtist() {
70
void SongsModel::setAlbumArtist(const QString album_artist) {
71
if (this->album_artist != album_artist) {
72
this->album_artist = album_artist;
77
int SongsModel::getLimit() {
81
void SongsModel::setLimit(int limit) {
82
if (this->limit != limit) {
88
void SongsModel::update() {
89
if (store == nullptr) {
90
updateResults(std::vector<mediascanner::MediaFile>());
92
updateResults(store->store.listSongs(artist.toStdString(), album.toStdString(), album_artist.toStdString(), limit));