2017-04-23 15:05:48 +02:00
|
|
|
#ifndef UPLOADERSINGLETON_HPP
|
|
|
|
#define UPLOADERSINGLETON_HPP
|
|
|
|
|
|
|
|
#include "uploader.hpp"
|
|
|
|
#include <QMap>
|
|
|
|
|
2017-04-25 21:27:29 +02:00
|
|
|
class UploaderSingleton : public QObject
|
2017-04-23 15:05:48 +02:00
|
|
|
{
|
2017-04-25 21:27:29 +02:00
|
|
|
Q_OBJECT
|
2017-04-23 15:05:48 +02:00
|
|
|
public:
|
|
|
|
static UploaderSingleton &inst()
|
|
|
|
{
|
|
|
|
static UploaderSingleton inst;
|
|
|
|
return inst;
|
|
|
|
}
|
|
|
|
void registerUploader(Uploader *uploader);
|
|
|
|
void upload(QPixmap *pixmap);
|
|
|
|
QList<Uploader *> uploaderList();
|
|
|
|
void set(QString uploader);
|
|
|
|
QString selectedUploader();
|
2017-04-25 16:04:46 +02:00
|
|
|
QList<std::runtime_error> errors();
|
2017-04-25 21:27:29 +02:00
|
|
|
signals:
|
|
|
|
void newUploader(Uploader *u);
|
2017-04-23 15:05:48 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
UploaderSingleton();
|
|
|
|
QMap<QString, Uploader *> uploaders;
|
|
|
|
QString uploader = "imgur";
|
2017-04-25 16:04:46 +02:00
|
|
|
QList<std::runtime_error> errs;
|
2017-04-23 15:05:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UPLOADERSINGLETON_HPP
|