diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-06-28 17:07:08 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-28 17:07:08 +0200 |
commit | e8731c5d013e67ee0153d5a49b38b0e914d14aa0 (patch) | |
tree | ab3611681ec35ea8f10aa7b9a7770c1356b3ef22 /logic/screenshots/ImgurUpload.cpp | |
parent | 30b1f5e5cf935689fc628e37016e650655153d00 (diff) | |
download | MultiMC-e8731c5d013e67ee0153d5a49b38b0e914d14aa0.tar MultiMC-e8731c5d013e67ee0153d5a49b38b0e914d14aa0.tar.gz MultiMC-e8731c5d013e67ee0153d5a49b38b0e914d14aa0.tar.lz MultiMC-e8731c5d013e67ee0153d5a49b38b0e914d14aa0.tar.xz MultiMC-e8731c5d013e67ee0153d5a49b38b0e914d14aa0.zip |
Turn screenshot management into a page.
Diffstat (limited to 'logic/screenshots/ImgurUpload.cpp')
-rw-r--r-- | logic/screenshots/ImgurUpload.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/logic/screenshots/ImgurUpload.cpp b/logic/screenshots/ImgurUpload.cpp index 62033ef5..f305aec0 100644 --- a/logic/screenshots/ImgurUpload.cpp +++ b/logic/screenshots/ImgurUpload.cpp @@ -8,7 +8,6 @@ #include <QFile> #include <QUrl> -#include "logic/screenshots/ScreenshotList.h" #include "logic/net/URLConstants.h" #include "MultiMC.h" #include "logger/QsLog.h" @@ -27,7 +26,7 @@ void ImgurUpload::start() request.setRawHeader("Authorization", "Client-ID 5b97b0713fba4a3"); request.setRawHeader("Accept", "application/json"); - QFile f(m_shot->file); + QFile f(m_shot->m_file.absoluteFilePath()); if (!f.open(QFile::ReadOnly)) { emit failed(m_index_within_job); @@ -46,7 +45,7 @@ void ImgurUpload::start() multipart->append(typePart); QHttpPart namePart; namePart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data; name=\"name\""); - namePart.setBody(m_shot->timestamp.toString(Qt::ISODate).toUtf8()); + namePart.setBody(m_shot->m_file.baseName().toUtf8()); multipart->append(namePart); auto worker = MMC->qnam(); @@ -84,8 +83,8 @@ void ImgurUpload::downloadFinished() emit failed(m_index_within_job); return; } - m_shot->imgurId = object.value("data").toObject().value("id").toString(); - m_shot->url = object.value("data").toObject().value("link").toString(); + m_shot->m_imgurId = object.value("data").toObject().value("id").toString(); + m_shot->m_url = object.value("data").toObject().value("link").toString(); m_status = Job_Finished; emit succeeded(m_index_within_job); return; |