9f57a10bb8
Jeeeesh that's alot
19 lines
665 B
C++
19 lines
665 B
C++
#include "clipboarduploader.hpp"
|
|
|
|
#include <QApplication>
|
|
#include <QClipboard>
|
|
#include <QMimeData>
|
|
#include <formats.hpp>
|
|
#include <notifications.hpp>
|
|
|
|
void ClipboardUploader::doUpload(QByteArray imgData, QString format) {
|
|
auto f = formats::recordingFormatFromName(format);
|
|
if (f != formats::Recording::None) {
|
|
auto data = new QMimeData();
|
|
data->setData(formats::recordingFormatMIME(f), imgData);
|
|
QApplication::clipboard()->setMimeData(data);
|
|
} else
|
|
QApplication::clipboard()->setImage(QImage::fromData(imgData, format.toLocal8Bit().constData()));
|
|
notifications::notify(tr("KShare"), tr("Copied to clipboard!"));
|
|
}
|