NOISSUE use QObjectPtr for translations and screenshots
This commit is contained in:
parent
d8ea3501eb
commit
f061bf7a27
@ -287,7 +287,7 @@ void ScreenshotsPage::on_uploadBtn_clicked()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QList<ScreenshotPtr> uploaded;
|
QList<ScreenshotPtr> uploaded;
|
||||||
auto job = std::make_shared<NetJob>("Screenshot Upload");
|
auto job = NetJobPtr(new NetJob("Screenshot Upload"));
|
||||||
for (auto item : selection)
|
for (auto item : selection)
|
||||||
{
|
{
|
||||||
auto info = m_model->fileInfo(item);
|
auto info = m_model->fileInfo(item);
|
||||||
@ -296,11 +296,11 @@ void ScreenshotsPage::on_uploadBtn_clicked()
|
|||||||
job->addNetAction(ImgurUpload::make(screenshot));
|
job->addNetAction(ImgurUpload::make(screenshot));
|
||||||
}
|
}
|
||||||
SequentialTask task;
|
SequentialTask task;
|
||||||
auto albumTask = std::make_shared<NetJob>("Imgur Album Creation");
|
auto albumTask = NetJobPtr(new NetJob("Imgur Album Creation"));
|
||||||
auto imgurAlbum = ImgurAlbumCreation::make(uploaded);
|
auto imgurAlbum = ImgurAlbumCreation::make(uploaded);
|
||||||
albumTask->addNetAction(imgurAlbum);
|
albumTask->addNetAction(imgurAlbum);
|
||||||
task.addTask(job);
|
task.addTask(job.unwrap());
|
||||||
task.addTask(albumTask);
|
task.addTask(albumTask.unwrap());
|
||||||
ProgressDialog prog(this);
|
ProgressDialog prog(this);
|
||||||
if (prog.exec(&task) != QDialog::Accepted)
|
if (prog.exec(&task) != QDialog::Accepted)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +46,10 @@ public:
|
|||||||
{
|
{
|
||||||
return m_ptr.get() != nullptr;
|
return m_ptr.get() != nullptr;
|
||||||
}
|
}
|
||||||
|
const std::shared_ptr <T> unwrap() const
|
||||||
|
{
|
||||||
|
return m_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr <T> m_ptr;
|
std::shared_ptr <T> m_ptr;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <net/NetJob.h>
|
||||||
|
|
||||||
class ByteArrayDownload;
|
class ByteArrayDownload;
|
||||||
class NetJob;
|
class NetJob;
|
||||||
@ -25,6 +26,6 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ByteArrayDownload> m_index_task;
|
std::shared_ptr<ByteArrayDownload> m_index_task;
|
||||||
std::shared_ptr<NetJob> m_dl_job;
|
NetJobPtr m_dl_job;
|
||||||
std::shared_ptr<NetJob> m_index_job;
|
NetJobPtr m_index_job;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user