2018-06-28 05:02:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "computermanager.h"
|
|
|
|
#include <QDir>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QThreadPool>
|
|
|
|
#include <QRunnable>
|
|
|
|
|
|
|
|
class BoxArtManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
friend class NetworkBoxArtLoadTask;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit BoxArtManager(QObject *parent = nullptr);
|
|
|
|
|
2018-07-06 03:07:05 +00:00
|
|
|
QUrl
|
2018-06-28 05:02:29 +00:00
|
|
|
loadBoxArt(NvComputer* computer, NvApp& app);
|
|
|
|
|
2020-05-30 04:44:38 +00:00
|
|
|
static
|
|
|
|
void
|
|
|
|
deleteBoxArt(NvComputer* computer);
|
|
|
|
|
2018-06-28 05:02:29 +00:00
|
|
|
signals:
|
|
|
|
void
|
2018-07-06 03:07:05 +00:00
|
|
|
boxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image);
|
2018-06-28 05:02:29 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void
|
2018-07-06 03:07:05 +00:00
|
|
|
handleBoxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image);
|
2018-06-28 05:02:29 +00:00
|
|
|
|
|
|
|
private:
|
2018-07-06 03:07:05 +00:00
|
|
|
QUrl
|
2018-06-28 05:02:29 +00:00
|
|
|
loadBoxArtFromNetwork(NvComputer* computer, int appId);
|
|
|
|
|
|
|
|
QString
|
|
|
|
getFilePathForBoxArt(NvComputer* computer, int appId);
|
|
|
|
|
|
|
|
QDir m_BoxArtDir;
|
2018-09-08 00:02:52 +00:00
|
|
|
QThreadPool m_ThreadPool;
|
2018-06-28 05:02:29 +00:00
|
|
|
};
|