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 "AlbumsModel.hh"
22
using namespace mediascanner::qml;
24
AlbumsModel::AlbumsModel(QObject *parent)
25
: AlbumModelBase(parent),
32
MediaStoreWrapper *AlbumsModel::getStore() {
36
void AlbumsModel::setStore(MediaStoreWrapper *store) {
37
if (this->store != store) {
43
QString AlbumsModel::getArtist() {
47
void AlbumsModel::setArtist(const QString artist) {
48
if (this->artist != artist) {
49
this->artist = artist;
54
QString AlbumsModel::getAlbumArtist() {
58
void AlbumsModel::setAlbumArtist(const QString album_artist) {
59
if (this->album_artist != album_artist) {
60
this->album_artist = album_artist;
65
int AlbumsModel::getLimit() {
69
void AlbumsModel::setLimit(int limit) {
70
if (this->limit != limit) {
76
void AlbumsModel::update() {
77
if (store == nullptr) {
78
updateResults(std::vector<mediascanner::Album>());
80
updateResults(store->store.listAlbums(artist.toStdString(), album_artist.toStdString(), limit));