Commit 4b1c5509 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

PK: Improve changelog for appstream applications

It seems like expecting developers to offer a proper changelog is a lot
to ask. At least show something so the user isn't on his own to see
what's happening.

BUG: 397201
parent f804580a
......@@ -199,9 +199,9 @@ QStringList AppPackageKitResource::extends() const
return m_appdata.extends();
}
void AppPackageKitResource::fetchChangelog()
QString AppPackageKitResource::changelog() const
{
emit changelogFetched(AppStreamUtils::changelogToHtml(m_appdata));
return AppStreamUtils::changelogToHtml(m_appdata);
}
void AppPackageKitResource::invokeApplication() const
......
......@@ -48,10 +48,10 @@ class AppPackageKitResource : public PackageKitResource
QList<PackageState> addonsInformation() override;
QStringList extends() const override;
void fetchScreenshots() override;
void fetchChangelog() override;
void invokeApplication() const override;
bool canExecute() const override { return true; }
QDate releaseDate() const override;
QString changelog() const override;
private:
const AppStream::Component m_appdata;
......
......@@ -248,7 +248,7 @@ void PackageKitResource::updateDetail(const QString& /*packageID*/, const QStrin
if (!vendorUrls.isEmpty())
addIfNotEmpty(i18n("Vendor:"), urlToLinks(vendorUrls).join(QStringLiteral(", ")), info);
emit changelogFetched(info);
emit changelogFetched(changelog() + info);
}
PackageKitBackend* PackageKitResource::backend() const
......
......@@ -74,6 +74,8 @@ class PackageKitResource : public AbstractResource
QDate releaseDate() const override { return {}; }
virtual QString changelog() const { return {}; }
Q_SIGNALS:
void dependenciesFound(const QJsonObject& dependencies);
......
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