2017-04-23 15:05:48 +02:00
|
|
|
#ifndef UPLOADERSINGLETON_HPP
|
|
|
|
#define UPLOADERSINGLETON_HPP
|
|
|
|
|
|
|
|
#include "uploader.hpp"
|
2017-05-22 15:56:47 +02:00
|
|
|
#include <QDir>
|
2017-04-23 15:05:48 +02:00
|
|
|
#include <QMap>
|
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
class UploaderSingleton : public QObject {
|
2017-05-09 17:26:00 +02:00
|
|
|
Q_OBJECT
|
|
|
|
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();
|
|
|
|
QList<std::runtime_error> errors();
|
|
|
|
signals:
|
|
|
|
void newUploader(Uploader *u);
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
private:
|
2017-05-22 15:56:47 +02:00
|
|
|
QDir saveDir;
|
2017-05-09 17:26:00 +02:00
|
|
|
UploaderSingleton();
|
|
|
|
QMap<QString, Uploader *> uploaders;
|
|
|
|
QString uploader = "imgur";
|
|
|
|
QList<std::runtime_error> errs;
|
2017-04-23 15:05:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UPLOADERSINGLETON_HPP
|