diff options
Diffstat (limited to 'launcher/net/PasteUpload.cpp')
-rw-r--r-- | launcher/net/PasteUpload.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/launcher/net/PasteUpload.cpp b/launcher/net/PasteUpload.cpp index 7438e1a1..76b86743 100644 --- a/launcher/net/PasteUpload.cpp +++ b/launcher/net/PasteUpload.cpp @@ -44,8 +44,6 @@ #include <QJsonArray> #include <QJsonDocument> #include <QFile> -#include <QHttpPart> -#include <QUrlQuery> std::array<PasteUpload::PasteTypeInfo, 4> PasteUpload::PasteTypes = { {{"0x0.st", "https://0x0.st", ""}, @@ -131,10 +129,13 @@ void PasteUpload::executeTask() connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress); connect(rep, &QNetworkReply::finished, this, &PasteUpload::downloadFinished); - // This function call would be a lot shorter if we were using the latest Qt - connect(rep, - static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), - this, &PasteUpload::downloadError); + +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + connect(rep, &QNetworkReply::errorOccurred, this, &PasteUpload::downloadError); +#else + connect(rep, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &PasteUpload::downloadError); +#endif + m_reply = std::shared_ptr<QNetworkReply>(rep); |