2014-12-26 13:34:53 +01:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
Copyright 2010, 2012, John Maguire <john.maguire@gmail.com>
|
|
|
|
Copyright 2012, David Sansome <me@davidsansome.com>
|
|
|
|
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
|
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COVERS_KITTENLOADER_H_
|
|
|
|
#define COVERS_KITTENLOADER_H_
|
2010-12-10 15:26:29 +01:00
|
|
|
|
|
|
|
#include <QQueue>
|
|
|
|
#include <QUrl>
|
|
|
|
|
2020-09-18 16:15:19 +02:00
|
|
|
#include "albumcoverloader.h"
|
|
|
|
|
2012-10-12 12:38:12 +02:00
|
|
|
class QNetworkReply;
|
|
|
|
|
2010-12-10 15:26:29 +01:00
|
|
|
class KittenLoader : public AlbumCoverLoader {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-12-26 13:34:53 +01:00
|
|
|
explicit KittenLoader(QObject* parent = nullptr);
|
2010-12-10 15:26:29 +01:00
|
|
|
|
2012-02-13 21:44:04 +01:00
|
|
|
virtual quint64 LoadKitten(const AlbumCoverLoaderOptions& options);
|
2010-12-10 15:26:29 +01:00
|
|
|
|
|
|
|
private slots:
|
2012-10-12 12:38:12 +02:00
|
|
|
void KittensRetrieved(QNetworkReply* reply);
|
2010-12-10 15:26:29 +01:00
|
|
|
void FetchMoreKittens();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const char* kFlickrKittenUrl;
|
|
|
|
static const char* kFlickrPhotoUrl;
|
|
|
|
|
|
|
|
QQueue<Task> pending_kittens_;
|
|
|
|
QQueue<QUrl> kitten_urls_;
|
|
|
|
};
|
|
|
|
|
2014-12-26 13:34:53 +01:00
|
|
|
#endif // COVERS_KITTENLOADER_H_
|