Commit d5b3f7af authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make sure we don't show a spurious proceed dialog

parent 143d7345
......@@ -155,15 +155,15 @@ void PKTransaction::cleanup(PackageKit::Transaction::Exit exit, uint runtime)
}
removedResources.subtract(m_apps.toList().toSet());
QString msg = QStringLiteral("<ul><li>") + PackageKitResource::joinPackages(packagesToRemove, QStringLiteral("</li><li>"));
if (!removedResources.isEmpty()) {
const QStringList removedResourcesStr = kTransform<QStringList>(removedResources, [](AbstractResource* a) { return a->name(); });
msg += QLatin1Char('\n');
msg += removedResourcesStr.join(QStringLiteral("</li><li>"));
}
msg += QStringLiteral("</li></ul>");
if (!packagesToRemove.isEmpty() || !removedResources.isEmpty()) {
QString msg = QStringLiteral("<ul><li>") + PackageKitResource::joinPackages(packagesToRemove, QStringLiteral("</li><li>"));
if (!removedResources.isEmpty()) {
const QStringList removedResourcesStr = kTransform<QStringList>(removedResources, [](AbstractResource* a) { return a->name(); });
msg += QLatin1Char('\n');
msg += removedResourcesStr.join(QStringLiteral("</li><li>"));
}
msg += QStringLiteral("</li></ul>");
if (!msg.isEmpty()) {
Q_EMIT proceedRequest(i18n("Confirm..."), i18np("To proceed with this action, the following package needs removal:\n%2", "To proceed with this action, the following packages need removal:\n%2", packagesToRemove.count(), msg));
} else {
proceed();
......
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