why image clipboard didnt work. lel
This commit is contained in:
parent
872f26839f
commit
f5a7b56de9
@ -23,6 +23,7 @@ void clipboardcopy::copyClipboard() {
|
||||
|
||||
if(mimeData->hasImage()) {
|
||||
QPixmap map = qvariant_cast<QPixmap>(mimeData->imageData());
|
||||
UploaderSingleton::inst().upload(map, false);
|
||||
} else if(mimeData->hasText()) {
|
||||
#ifdef Q_OS_WIN
|
||||
QUrl fileUrl(mimeData->text());
|
||||
|
@ -53,7 +53,7 @@ void UploaderSingleton::registerUploader(Uploader *uploader) {
|
||||
emit newUploader(uploader);
|
||||
}
|
||||
|
||||
void UploaderSingleton::upload(QPixmap pixmap) {
|
||||
void UploaderSingleton::upload(QPixmap pixmap, bool save) {
|
||||
updateSaveSettings();
|
||||
auto u = uploaders.value(uploader);
|
||||
if (!u->validate()) {
|
||||
@ -63,7 +63,7 @@ void UploaderSingleton::upload(QPixmap pixmap) {
|
||||
}
|
||||
QString format = settings::settings().value("captureformat", "PNG").toString();
|
||||
QFile *file = nullptr;
|
||||
if (saveImages) {
|
||||
if (saveImages && save) {
|
||||
file = new QFile(saveDir.absoluteFilePath(
|
||||
formatter::format(settings::settings().value("fileFormat", "Screenshot %(yyyy-MM-dd HH-mm-ss)date.%ext").toString(),
|
||||
format.toLower())));
|
||||
@ -80,6 +80,10 @@ void UploaderSingleton::upload(QPixmap pixmap) {
|
||||
delete file;
|
||||
}
|
||||
|
||||
void UploaderSingleton::upload(QPixmap pixmap) {
|
||||
UploaderSingleton::upload(pixmap, true);
|
||||
}
|
||||
|
||||
void UploaderSingleton::upload(QByteArray img, QString format) {
|
||||
updateSaveSettings();
|
||||
if (img.isEmpty()) return;
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
return inst;
|
||||
}
|
||||
void registerUploader(Uploader *uploader);
|
||||
void upload(QPixmap pixmap, bool save);
|
||||
void upload(QPixmap pixmap);
|
||||
void upload(QByteArray img, QString format);
|
||||
void upload(QFile &img, QString format);
|
||||
|
Loading…
Reference in New Issue
Block a user