You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
764 B

#ifndef UPLOADERSINGLETON_HPP
#define UPLOADERSINGLETON_HPP
#include "uploader.hpp"
#include <QDir>
#include <QMap>
class UploaderSingleton : public QObject {
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);
private:
QDir saveDir;
UploaderSingleton();
QMap<QString, Uploader *> uploaders;
QString uploader = "imgur";
QList<std::runtime_error> errs;
};
#endif // UPLOADERSINGLETON_HPP