[gnome-software: 3/29] gs-plugin-generic-updates: Port to the new GsPlugin lifecycle




commit 924ed676d253865cad8fcb819503698ae95d322f
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu May 20 20:26:17 2021 +0100

    gs-plugin-generic-updates: Port to the new GsPlugin lifecycle
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 plugins/core/gs-plugin-generic-updates.c | 26 ++++++++++++++++++++++++--
 plugins/core/gs-plugin-generic-updates.h | 22 ++++++++++++++++++++++
 2 files changed, 46 insertions(+), 2 deletions(-)
---
diff --git a/plugins/core/gs-plugin-generic-updates.c b/plugins/core/gs-plugin-generic-updates.c
index ee4e3af21..935deb627 100644
--- a/plugins/core/gs-plugin-generic-updates.c
+++ b/plugins/core/gs-plugin-generic-updates.c
@@ -11,9 +11,20 @@
 #include <glib/gi18n.h>
 #include <gnome-software.h>
 
-void
-gs_plugin_initialize (GsPlugin *plugin)
+#include "gs-plugin-generic-updates.h"
+
+struct _GsPluginGenericUpdates
+{
+       GsPlugin                 parent;
+};
+
+G_DEFINE_TYPE (GsPluginGenericUpdates, gs_plugin_generic_updates, GS_TYPE_PLUGIN)
+
+static void
+gs_plugin_generic_updates_init (GsPluginGenericUpdates *self)
 {
+       GsPlugin *plugin = GS_PLUGIN (self);
+
        gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_AFTER, "appstream");
        gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_AFTER, "packagekit");
        gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_AFTER, "rpm-ostree");
@@ -102,3 +113,14 @@ gs_plugin_refine (GsPlugin *plugin,
        gs_app_list_add (list, app);
        return TRUE;
 }
+
+static void
+gs_plugin_generic_updates_class_init (GsPluginGenericUpdatesClass *klass)
+{
+}
+
+GType
+gs_plugin_query_type (void)
+{
+       return GS_TYPE_PLUGIN_GENERIC_UPDATES;
+}
diff --git a/plugins/core/gs-plugin-generic-updates.h b/plugins/core/gs-plugin-generic-updates.h
new file mode 100644
index 000000000..1b2448c3e
--- /dev/null
+++ b/plugins/core/gs-plugin-generic-updates.h
@@ -0,0 +1,22 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ * vi:set noexpandtab tabstop=8 shiftwidth=8:
+ *
+ * Copyright (C) 2021 Endless OS Foundation LLC
+ *
+ * Author: Philip Withnall <pwithnall endlessos org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#pragma once
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GS_TYPE_PLUGIN_GENERIC_UPDATES (gs_plugin_generic_updates_get_type ())
+
+G_DECLARE_FINAL_TYPE (GsPluginGenericUpdates, gs_plugin_generic_updates, GS, PLUGIN_GENERIC_UPDATES, 
GsPlugin)
+
+G_END_DECLS


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