diff --git a/discover/qml/UpdatesPage.qml b/discover/qml/UpdatesPage.qml --- a/discover/qml/UpdatesPage.qml +++ b/discover/qml/UpdatesPage.qml @@ -178,7 +178,7 @@ property: "section" delegate: Kirigami.Heading { x: Kirigami.Units.gridUnit - level: 3 + level: 2 text: section height: implicitHeight + Kirigami.Units.largeSpacing * 2 } @@ -223,10 +223,22 @@ smooth: true } - Label { - Layout.fillWidth: true - text: i18n("%1 (%2)", display, version) - elide: Text.ElideRight + ColumnLayout { + + // App name + Kirigami.Heading { + Layout.fillWidth: true + text: i18n("%1", display) + level: 3 + elide: Text.ElideRight + } + + // Old and new version numbers + Label { + Layout.fillWidth: true + elide: Text.ElideRight + text: i18n("%1 ⮕ %2", installedVersion, availableVersion) + } } LabelBackground { diff --git a/libdiscover/UpdateModel/UpdateItem.h b/libdiscover/UpdateModel/UpdateItem.h --- a/libdiscover/UpdateModel/UpdateItem.h +++ b/libdiscover/UpdateModel/UpdateItem.h @@ -44,7 +44,9 @@ AbstractResource *app() const; QString name() const; - QString version() const; + QString version() const; // Deprecated; use availableVersion() instead + QString availableVersion() const; + QString installedVersion() const; QVariant icon() const; qint64 size() const; Qt::CheckState checked() const; diff --git a/libdiscover/UpdateModel/UpdateItem.cpp b/libdiscover/UpdateModel/UpdateItem.cpp --- a/libdiscover/UpdateModel/UpdateItem.cpp +++ b/libdiscover/UpdateModel/UpdateItem.cpp @@ -47,11 +47,22 @@ return m_app->name(); } +// Deprecated; use availableVersion() instead QString UpdateItem::version() const { return m_app->availableVersion(); } +QString UpdateItem::availableVersion() const +{ + return m_app->availableVersion(); +} + +QString UpdateItem::installedVersion() const +{ + return m_app->installedVersion(); +} + QVariant UpdateItem::icon() const { return m_app->icon(); diff --git a/libdiscover/UpdateModel/UpdateModel.h b/libdiscover/UpdateModel/UpdateModel.h --- a/libdiscover/UpdateModel/UpdateModel.h +++ b/libdiscover/UpdateModel/UpdateModel.h @@ -40,13 +40,14 @@ public: enum Roles { - VersionRole = Qt::UserRole + 1, - SizeRole, + SizeRole = Qt::UserRole + 1, ResourceRole, ResourceProgressRole, SectionResourceProgressRole, ChangelogRole, - SectionRole + SectionRole, + InstalledVersionRole, + AvailableVersionRole }; Q_ENUM(Roles) diff --git a/libdiscover/UpdateModel/UpdateModel.cpp b/libdiscover/UpdateModel/UpdateModel.cpp --- a/libdiscover/UpdateModel/UpdateModel.cpp +++ b/libdiscover/UpdateModel/UpdateModel.cpp @@ -63,9 +63,10 @@ { ResourceProgressRole, "resourceProgress" }, { ResourceRole, "resource" }, { SizeRole, "size" }, - { VersionRole, "version" }, { SectionRole, "section" }, - { ChangelogRole, "changelog" } + { ChangelogRole, "changelog" }, + { InstalledVersionRole, "installedVersion" }, + { AvailableVersionRole, "availableVersion" } } ); } @@ -124,8 +125,10 @@ return item->icon(); case Qt::CheckStateRole: return item->checked(); - case VersionRole: - return item->version(); + case InstalledVersionRole: + return item->installedVersion(); + case AvailableVersionRole: + return item->availableVersion(); case SizeRole: return KFormat().formatByteSize(item->size()); case ResourceRole: @@ -332,7 +335,7 @@ const auto index = indexFromItem(item); if (properties.contains("state")) - Q_EMIT dataChanged(index, index, {SizeRole, VersionRole}); + Q_EMIT dataChanged(index, index, {SizeRole, AvailableVersionRole}); else if (properties.contains("size")) { Q_EMIT dataChanged(index, index, {SizeRole}); m_updateSizeTimer->start(); diff --git a/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp b/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp --- a/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp +++ b/libdiscover/backends/PackageKitBackend/PackageKitResource.cpp @@ -282,9 +282,8 @@ const auto name = PackageKit::Daemon::packageName(packageID); QString info; - addIfNotEmpty(i18n("Current Version:"), joinPackages(updates, {}, name), info); addIfNotEmpty(i18n("Obsoletes:"), joinPackages(obsoletes, {}, name), info); - addIfNotEmpty(i18n("New Version:"), updateText, info); + addIfNotEmpty(i18n("Release Notes:"), updateText, info); addIfNotEmpty(i18n("Update State:"), PackageKitMessages::updateStateMessage(state), info); addIfNotEmpty(i18n("Restart:"), PackageKitMessages::restartMessage(restart), info);