[gnome-software] Only refine with PackageKit when the application history is missing and required



commit aa3da18025d84c65c51d2dcdf3152938d40afa2f
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 21 13:56:13 2013 +0100

    Only refine with PackageKit when the application history is missing and required

 src/gs-plugin.h                            |    1 +
 src/gs-shell-details.c                     |    1 +
 src/gs-shell-installed.c                   |    1 +
 src/gs-shell-search.c                      |    1 +
 src/plugins/gs-plugin-packagekit-history.c |    3 +++
 5 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 4c1906a..7cf8242 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -84,6 +84,7 @@ typedef enum {
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE             = 1 << 4,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING           = 1 << 5,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION          = 1 << 6,
+       GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY          = 1 << 7,
        GS_PLUGIN_REFINE_FLAGS_LAST
 } GsPluginRefineFlags;
 
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index a3df389..f4f1593 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -597,6 +597,7 @@ gs_shell_details_set_app (GsShellDetails *shell_details, GsApp *app)
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE |
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
+                                          GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY|
                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL,
                                           priv->cancellable,
                                           gs_shell_details_app_refine_cb,
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 2cb4de7..c26e535 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -322,6 +322,7 @@ gs_shell_installed_refresh (GsShellInstalled *shell_installed, gboolean scroll_u
        /* get popular apps */
        gs_plugin_loader_get_installed_async (priv->plugin_loader,
                                              GS_PLUGIN_REFINE_FLAGS_DEFAULT |
+                                             GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY |
                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION,
                                              priv->cancellable,
                                              gs_shell_installed_get_installed_cb,
diff --git a/src/gs-shell-search.c b/src/gs-shell-search.c
index 072a5e5..7c5846b 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-shell-search.c
@@ -323,6 +323,7 @@ gs_shell_search_refresh (GsShellSearch *shell_search, const gchar *value, gboole
                                       value,
                                       GS_PLUGIN_REFINE_FLAGS_DEFAULT |
                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
+                                      GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY |
                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
                                       priv->cancellable,
                                       gs_shell_search_get_search_cb,
diff --git a/src/plugins/gs-plugin-packagekit-history.c b/src/plugins/gs-plugin-packagekit-history.c
index b5e831b..bac3e0c 100644
--- a/src/plugins/gs-plugin-packagekit-history.c
+++ b/src/plugins/gs-plugin-packagekit-history.c
@@ -268,6 +268,9 @@ gs_plugin_refine (GsPlugin *plugin,
        GList *packages = NULL;
        GsApp *app;
 
+       if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY) == 0)
+               goto out;
+
        /* add any missing history data */
        for (l = list; l != NULL; l = l->next) {
                app = GS_APP (l->data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]