[gnome-software: 2/11] gs-plugin: Add list_distro_upgrades_{async, finish}() vfuncs




commit 87ec71a29d15d7be73e41f45c8e4ea9b2c049b5e
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Mar 2 15:25:03 2022 +0000

    gs-plugin: Add list_distro_upgrades_{async,finish}() vfuncs
    
    These will eventually replace the `gs_plugin_add_distro_upgrades()`
    function.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 lib/gs-plugin-types.h | 14 ++++++++++++++
 lib/gs-plugin.h       | 13 +++++++++++++
 2 files changed, 27 insertions(+)
---
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 50373f682..05380218b 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -184,6 +184,20 @@ typedef enum {
        GS_PLUGIN_REFRESH_METADATA_FLAGS_INTERACTIVE = 1 << 0,
 } GsPluginRefreshMetadataFlags;
 
+/**
+ * GsPluginListDistroUpgradesFlags:
+ * @GS_PLUGIN_LIST_DISTRO_UPGRADES_FLAGS_NONE: No flags set.
+ * @GS_PLUGIN_LIST_DISTRO_UPGRADES_FLAGS_INTERACTIVE: User initiated the job.
+ *
+ * Flags for an operation to list available distro upgrades.
+ *
+ * Since: 42
+ */
+typedef enum {
+       GS_PLUGIN_LIST_DISTRO_UPGRADES_FLAGS_NONE = 0,
+       GS_PLUGIN_LIST_DISTRO_UPGRADES_FLAGS_INTERACTIVE = 1 << 0,
+} GsPluginListDistroUpgradesFlags;
+
 /**
  * GsPluginRule:
  * @GS_PLUGIN_RULE_CONFLICTS:          The plugin conflicts with another
diff --git a/lib/gs-plugin.h b/lib/gs-plugin.h
index 6ff0ad424..c9b5e5818 100644
--- a/lib/gs-plugin.h
+++ b/lib/gs-plugin.h
@@ -60,6 +60,10 @@ G_DECLARE_DERIVABLE_TYPE (GsPlugin, gs_plugin, GS, PLUGIN, GObject)
  * @refresh_metadata_finish: (nullable): Finish method for
  *   @refresh_metadata_async. Must be implemented if @refresh_metadata_async is
  *   implemented.
+ * @list_distro_upgrades_async: (nullable): List available distro upgrades.
+ * @list_distro_upgrades_finish: (nullable): Finish method for
+ *   @list_distro_upgrades_async. Must be implemented if
+ *   @list_distro_upgrades_async is implemented.
  *
  * The class structure for a #GsPlugin. Virtual methods here should be
  * implemented by plugin implementations derived from #GsPlugin to provide their
@@ -134,6 +138,15 @@ struct _GsPluginClass
                                                                 GAsyncResult           *result,
                                                                 GError                 **error);
 
+       void                    (*list_distro_upgrades_async)   (GsPlugin               *plugin,
+                                                                GsPluginListDistroUpgradesFlags flags,
+                                                                GCancellable           *cancellable,
+                                                                GAsyncReadyCallback     callback,
+                                                                gpointer                user_data);
+       GsAppList *             (*list_distro_upgrades_finish)  (GsPlugin               *plugin,
+                                                                GAsyncResult           *result,
+                                                                GError                 **error);
+
        gpointer                 padding[23];
 };
 


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