Commit ed54e6fb authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

When installing a resource with several payloads, fetch all of them

Instead of just randomly fetching the first one.

BUG: 395720
parent 32b1b3e9
......@@ -255,11 +255,13 @@ public:
TransactionModel::global()->addTransaction(this);
QTimer::singleShot(0, this, [this, res]() {
auto engine = res->knsBackend()->engine();
if (this->role() == InstallRole)
engine->install(res->entry());
else if(this->role() == RemoveRole)
engine->uninstall(res->entry());
for(auto i : res->linkIds()) {
auto engine = res->knsBackend()->engine();
if (this->role() == InstallRole)
engine->install(res->entry(), i);
else if(this->role() == RemoveRole)
engine->uninstall(res->entry());
}
});
}
......
......@@ -234,3 +234,14 @@ QDate KNSResource::releaseDate() const
{
return m_entry.updateReleaseDate().isNull() ? m_entry.releaseDate() : m_entry.updateReleaseDate();
}
QVector<int> KNSResource::linkIds() const
{
QVector<int> ids;
for(auto e : m_entry.downloadLinkInformationList()) {
if (e.isDownloadtypeLink)
ids << e.id;
}
return ids;
}
......@@ -67,6 +67,7 @@ public:
QString executeLabel() const override;
QString sourceIcon() const override { return QStringLiteral("get-hot-new-stuff"); }
QDate releaseDate() const override;
QVector<int> linkIds() const;
private:
const QStringList m_categories;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment