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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user