summaryrefslogtreecommitdiffstats
path: root/webdownloader.h
blob: 522ec86f1c3efdbf6a153abffffed93999f6b194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef WEBDOWNLOADER_H
#define WEBDOWNLOADER_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QMap>

class WebDownloader : public QObject {
    Q_OBJECT
    public:
        WebDownloader(QObject *parent = 0);
        void fetchData(QString artist, QString album);
        const QString album() const { return mAlbum; }
        const QString artist() const { return mArtist; }
        const QStringList data() const { return mData; }
        const QMap<QString, QString> otherData() const { return mOtherData; }

    signals:
        void done();

    private slots:
        void dlFinished(QNetworkReply *reply);

    private:
        QNetworkAccessManager *mAccessMgr;
        QString mArtist;
        QString mAlbum;
        QStringList mData;
        QMap<QString, QString> mOtherData;
};

#endif // WEBDOWNLOADER_H