From 970503b7554196fc3081dda5ec961eb9aaf2a412 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 26 Sep 2019 14:42:30 +0200 Subject: [PATCH] Apply last suggestion and fix mistake not letting the user upload an image after attempting to upload a file that is not an image. --- src/util/NuulsUploader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/NuulsUploader.cpp b/src/util/NuulsUploader.cpp index 05ae31b49..6fd27efc1 100644 --- a/src/util/NuulsUploader.cpp +++ b/src/util/NuulsUploader.cpp @@ -106,7 +106,7 @@ void upload(const QMimeData *source, ChannelPtr channel, { for (const QUrl &path : source->urls()) { - if (getImageFileFormat(path.toLocalFile()) != QString()) + if (!getImageFileFormat(path.toLocalFile()).isEmpty()) { channel->addMessage(makeSystemMessage( QString("Uploading image: %1").arg(path.toLocalFile()))); @@ -147,6 +147,7 @@ void upload(const QMimeData *source, ChannelPtr channel, channel->addMessage(makeSystemMessage( QString("Cannot upload file: %1, not an image") .arg(path.toLocalFile()))); + isUploading = false; } } if (uploadQueue.size())