KShare/uploaders/default/clipboarduploader.cpp
ArsenArsen 34624e5762 Redesigned uploaders a bit to support more stuff.
Added a functionality of uploading byte arrays and even files. Created RecordingFormat, which allows me to create states, I guess??, for RecordingContex's. Needed for, eg. gifs, which are horrible and I strongly suggest against, which will actually be stored as files per frame which are QImages encoded with QImage::Format_RGB888 (confirmation needed).
2017-06-04 22:58:29 +02:00

11 lines
345 B
C++

#include "clipboarduploader.hpp"
#include <QApplication>
#include <QClipboard>
#include <notifications.hpp>
void ClipboardUploader::doUpload(QByteArray imgData) {
QApplication::clipboard()->setImage(QImage::fromData(imgData, std::get<0>(format()).toLocal8Bit().constData()));
notifications::notify("KShare", "Copied to clipboard!");
}