diff --git a/application/pages/ScreenshotsPage.cpp b/application/pages/ScreenshotsPage.cpp index c81de407..9174b33b 100644 --- a/application/pages/ScreenshotsPage.cpp +++ b/application/pages/ScreenshotsPage.cpp @@ -287,7 +287,7 @@ void ScreenshotsPage::on_uploadBtn_clicked() return; QList uploaded; - auto job = std::make_shared("Screenshot Upload"); + auto job = NetJobPtr(new NetJob("Screenshot Upload")); for (auto item : selection) { auto info = m_model->fileInfo(item); @@ -296,11 +296,11 @@ void ScreenshotsPage::on_uploadBtn_clicked() job->addNetAction(ImgurUpload::make(screenshot)); } SequentialTask task; - auto albumTask = std::make_shared("Imgur Album Creation"); + auto albumTask = NetJobPtr(new NetJob("Imgur Album Creation")); auto imgurAlbum = ImgurAlbumCreation::make(uploaded); albumTask->addNetAction(imgurAlbum); - task.addTask(job); - task.addTask(albumTask); + task.addTask(job.unwrap()); + task.addTask(albumTask.unwrap()); ProgressDialog prog(this); if (prog.exec(&task) != QDialog::Accepted) { diff --git a/logic/QObjectPtr.h b/logic/QObjectPtr.h index 74c6e82a..2bde1bd8 100644 --- a/logic/QObjectPtr.h +++ b/logic/QObjectPtr.h @@ -46,6 +46,10 @@ public: { return m_ptr.get() != nullptr; } + const std::shared_ptr unwrap() const + { + return m_ptr; + } private: std::shared_ptr m_ptr; diff --git a/logic/trans/TranslationDownloader.h b/logic/trans/TranslationDownloader.h index 450b714b..6bcb223f 100644 --- a/logic/trans/TranslationDownloader.h +++ b/logic/trans/TranslationDownloader.h @@ -4,6 +4,7 @@ #include #include #include +#include class ByteArrayDownload; class NetJob; @@ -25,6 +26,6 @@ private slots: private: std::shared_ptr m_index_task; - std::shared_ptr m_dl_job; - std::shared_ptr m_index_job; -}; \ No newline at end of file + NetJobPtr m_dl_job; + NetJobPtr m_index_job; +};