refactor(RD): decouple ResourceModels from ResourcePages

This makes it so that we don't need a reference to the parent page in
the model. It will be useful once we change the page from a widget-based
one to a QML page.

It also makes tasks be created in the dialog instead of the page, so
that the dialog can also have the necessary information to mark versions
as selected / deselected easily. It also makes the task pointers into
smart pointers.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-12-18 15:41:46 -03:00
parent 39b7ac90d4
commit 45d1319891
28 changed files with 187 additions and 138 deletions

View File

@ -79,7 +79,7 @@ NetJob::Ptr NetworkResourceAPI::getProjectVersions(VersionSearchArgs&& args, Ver
auto versions_url = versions_url_optional.value();
auto netJob = new NetJob(QString("%1::Versions").arg(args.addonId), APPLICATION->network());
auto netJob = new NetJob(QString("%1::Versions").arg(args.pack.name), APPLICATION->network());
auto response = new QByteArray();
netJob->addNetAction(Net::Download::makeByteArray(versions_url, response));
@ -94,7 +94,7 @@ NetJob::Ptr NetworkResourceAPI::getProjectVersions(VersionSearchArgs&& args, Ver
return;
}
callbacks.on_succeed(doc, args.addonId);
callbacks.on_succeed(doc, args.pack);
});
QObject::connect(netJob, &NetJob::finished, [response] {