[gnome-software] trivial: Add an action of GET_UPDATES_HISTORICAL to be used internally
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Add an action of GET_UPDATES_HISTORICAL to be used internally
- Date: Fri, 19 May 2017 15:34:22 +0000 (UTC)
commit e2889758d16776c5e79523716fda83d9609ce303
Author: Richard Hughes <richard hughsie com>
Date: Fri May 19 10:14:46 2017 +0100
trivial: Add an action of GET_UPDATES_HISTORICAL to be used internally
Logically, it's a different thing to GET_UPDATES.
lib/gs-plugin-loader.c | 7 +++++--
lib/gs-plugin-types.h | 2 ++
lib/gs-plugin.c | 2 ++
3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 2c871d3..2c74d8a 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -1344,7 +1344,7 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
GError *error = NULL;
/* do things that would block */
- if ((helper->refine_flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY) > 0) {
+ if (helper->action == GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL) {
helper->function_name = "gs_plugin_add_updates_historical";
helper->list = gs_plugin_loader_run_results (helper, cancellable, &error);
if (helper->list == NULL) {
@@ -1428,7 +1428,10 @@ gs_plugin_loader_get_updates_async (GsPluginLoader *plugin_loader,
helper = gs_plugin_loader_helper_new (plugin_loader);
helper->refine_flags = refine_flags;
helper->failure_flags = failure_flags;
- helper->action = GS_PLUGIN_ACTION_GET_UPDATES;
+ if ((helper->refine_flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY) > 0)
+ helper->action = GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL;
+ else
+ helper->action = GS_PLUGIN_ACTION_GET_UPDATES;
gs_plugin_loader_helper_debug (helper);
/* run in a thread */
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 077a38e..a6e2533 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -263,6 +263,7 @@ typedef enum {
* @GS_PLUGIN_ACTION_AUTH_LOST_PASSWORD: Authentication lost password action
* @GS_PLUGIN_ACTION_URL_TO_APP: Convert the file to an application
* @GS_PLUGIN_ACTION_GET_RECENT: Get the apps recently released
+ * @GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL: Get the list of historical updates
*
* The plugin action.
**/
@@ -306,6 +307,7 @@ typedef enum {
GS_PLUGIN_ACTION_AUTH_LOST_PASSWORD,
GS_PLUGIN_ACTION_URL_TO_APP,
GS_PLUGIN_ACTION_GET_RECENT,
+ GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL,
/*< private >*/
GS_PLUGIN_ACTION_LAST
} GsPluginAction;
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index ddb6912..afe11f4 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1757,6 +1757,8 @@ gs_plugin_action_to_string (GsPluginAction action)
return "auth-lost-password";
if (action == GS_PLUGIN_ACTION_GET_RECENT)
return "get-recent";
+ if (action == GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL)
+ return "get-updates-historical";
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]