Applied a bit of foutf's suggestions. Replace uploadQueue.size() with .empty() and swap if/else bodies, move non empty queue check outside of the timer on line 60, move getImageFileFormat to an anonymous namespace, rename pasteFromClipoard to upload(), removed usesless comment, shortened message on line 83, use QMimeData.hasUrls() and QMimeData.urls(), moved GIF format case in upload() more to the top, call original functions in canInsertFromMimeData and dragEnterEvent which are overriden

This commit is contained in:
Mm2PL
2019-09-25 22:21:26 +02:00
parent 298c013fa0
commit 4e9951371f
4 changed files with 99 additions and 97 deletions
+10 -7
View File
@@ -9,11 +9,14 @@ struct TypedBytes {
QByteArray data;
QString type;
};
void uploadImageToNuuls(QByteArray imageData, ChannelPtr channel,
ResizingTextEdit &textEdit, std::string format);
void uploadImageToNuuls(TypedBytes imageData, ChannelPtr channel,
ResizingTextEdit &textEdit);
QString getImageFileFormat(QString path);
void pasteFromClipboard(const QMimeData *source, ChannelPtr channel,
ResizingTextEdit &outputTextEdit);
void upload(QByteArray imageData, ChannelPtr channel,
ResizingTextEdit &textEdit, std::string format);
void upload(TypedBytes imageData, ChannelPtr channel,
ResizingTextEdit &textEdit);
void upload(const QMimeData *source, ChannelPtr channel,
ResizingTextEdit &outputTextEdit);
} // namespace chatterino
namespace {
QString getImageFileFormat(QString path);
}