[gnome-software/wip/ubuntu-xenial] Show version for uninstalled packages
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/ubuntu-xenial] Show version for uninstalled packages
- Date: Mon, 25 Apr 2016 15:25:12 +0000 (UTC)
commit 5fd0242ab35b70a8d87a8aae533bc6be11bebc3c
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Apr 25 17:24:58 2016 +0200
Show version for uninstalled packages
src/plugins/gs-plugin-apt.cc | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.cc b/src/plugins/gs-plugin-apt.cc
index 69dbf17..317d750 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -390,11 +390,12 @@ look_at_pkg (const pkgCache::PkgIterator &P,
if (current)
info->installed_version = g_strdup (current.VerStr ());
+ if (candidate)
+ info->update_version = g_strdup (candidate.VerStr ());
info->section = g_strdup (candidate.Section ());
info->architecture = g_strdup (P.Arch ());
if (info->installed_version) {
- info->update_version = g_strdup (candidate.VerStr ());
plugin->priv->installed_packages =
g_list_append (plugin->priv->installed_packages, info);
}
@@ -403,7 +404,7 @@ look_at_pkg (const pkgCache::PkgIterator &P,
if (g_strcmp0 (info->installed_version, info->update_version) == 0)
g_clear_pointer (&info->update_version, g_free);
- if (info->update_version)
+ if (info->installed_version && info->update_version)
plugin->priv->updatable_packages =
g_list_append (plugin->priv->updatable_packages, info);
@@ -640,6 +641,8 @@ gs_plugin_refine (GsPlugin *plugin,
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION) != 0) {
if (info->installed_version != NULL) {
gs_app_set_version (app, info->installed_version);
+ } else {
+ gs_app_set_version (app, info->update_version);
}
if (info->update_version != NULL) {
gs_app_set_update_version (app, info->update_version);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]