Commit 3ffe650a authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

Make basic KNS updating (and installing multi-item entries) work

Prior to this, the only KNS entries which would be able to install
correctly were entries with exactly one download item in them. This
patch fixes this part of the issue.

The second part of a fix, to ensure things work correctly, is to forward
questions from KNS correctly, but this will require deeper intervention
in Discover, to allow proceed requests to also offer options other than
a yes/no style thing (specifically for this purpose, we need to be able
to pick from a list of items).
parent dfef8bd0
...@@ -442,14 +442,12 @@ public: ...@@ -442,14 +442,12 @@ public:
engine->uninstall(res->entry()); engine->uninstall(res->entry());
}; };
else if (res->linkIds().isEmpty()) else if (res->linkIds().isEmpty())
actionFunction = [res, engine]() { actionFunction = [res]() {
engine->install(res->entry()); qWarning() << "No installable candidates in the KNewStuff entry" << res->entry().name() << "with id" << res->entry().uniqueId() << "on the backend" << res->backend()->name() << "There should always be at least one downloadable item in an OCS entry, and if there isn't, we should consider it broken. OCS can technically show them, but if there is nothing to install, it cannot be installed.";
}; };
else else
actionFunction = [res, engine]() { actionFunction = [res, engine]() {
const auto links = res->linkIds(); engine->install(res->entry());
for(auto i : links)
engine->install(res->entry(), i);
}; };
QTimer::singleShot(0, res, actionFunction); QTimer::singleShot(0, res, actionFunction);
} }
Markdown is supported
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