[gnome-software/wip/william/update-all: 71/75] Add gs_plugin_loader_update_all_async/finish()



commit fe553a051634d1535981a2fb2d105a124e2a85c5
Author: William Hua <william hua canonical com>
Date:   Wed Apr 6 12:29:02 2016 +0100

    Add gs_plugin_loader_update_all_async/finish()

 src/gs-plugin-loader.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 src/gs-plugin-loader.h |    8 ++++++++
 src/gs-plugin.h        |    4 ++++
 3 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index bb3e07e..8dc7914 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -3882,6 +3882,48 @@ gs_plugin_loader_offline_update_finish (GsPluginLoader *plugin_loader,
 /******************************************************************************/
 
 /**
+ * gs_plugin_loader_update_all_async:
+ *
+ * This method calls all plugins that implement the gs_plugin_update_all()
+ * function.
+ **/
+void
+gs_plugin_loader_update_all_async (GsPluginLoader *plugin_loader,
+                                   GList *apps,
+                                   GCancellable *cancellable,
+                                   GAsyncReadyCallback callback,
+                                   gpointer user_data)
+{
+       g_return_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader));
+       g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+
+       gs_plugin_loader_iterate_app_list_async (plugin_loader,
+                                                "gs_plugin_update_all",
+                                                apps,
+                                                cancellable,
+                                                callback,
+                                                user_data);
+}
+
+/**
+ * gs_plugin_loader_update_all_finish:
+ **/
+gboolean
+gs_plugin_loader_update_all_finish (GsPluginLoader *plugin_loader,
+                                    GAsyncResult *res,
+                                    GError **error)
+{
+       g_return_val_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader), FALSE);
+       g_return_val_if_fail (G_IS_TASK (res), FALSE);
+       g_return_val_if_fail (g_task_is_valid (res, plugin_loader), FALSE);
+       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+       return gs_plugin_loader_iterate_app_list_finish (plugin_loader, res, error);
+}
+
+/******************************************************************************/
+
+/**
  * gs_plugin_loader_get_plugin_supported:
  *
  * This function returns TRUE if the symbol is found in any enabled plugin.
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 2365cb0..4a981cc 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -188,6 +188,14 @@ void                gs_plugin_loader_offline_update_async  (GsPluginLoader 
*plugin_loader,
 gboolean        gs_plugin_loader_offline_update_finish (GsPluginLoader *plugin_loader,
                                                         GAsyncResult   *res,
                                                         GError         **error);
+void            gs_plugin_loader_update_all_async      (GsPluginLoader *plugin_loader,
+                                                        GList          *apps,
+                                                        GCancellable   *cancellable,
+                                                        GAsyncReadyCallback callback,
+                                                        gpointer        user_data);
+gboolean        gs_plugin_loader_update_all_finish     (GsPluginLoader *plugin_loader,
+                                                        GAsyncResult   *res,
+                                                        GError         **error);
 gboolean        gs_plugin_loader_setup                 (GsPluginLoader *plugin_loader,
                                                         GError         **error);
 void            gs_plugin_loader_dump_state            (GsPluginLoader *plugin_loader);
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index a9e6914..a8d3aaf 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -336,6 +336,10 @@ gboolean    gs_plugin_offline_update               (GsPlugin       *plugin,
                                                         GList          *apps,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
+gboolean        gs_plugin_update_all                   (GsPlugin       *plugin,
+                                                        GList          *apps,
+                                                        GCancellable   *cancellable,
+                                                        GError         **error);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GsAppList, gs_plugin_list_free)
 


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