[gnome-software: 4/29] gs-plugin-hardcoded-blocklist: Port to the new GsPlugin lifecycle
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 4/29] gs-plugin-hardcoded-blocklist: Port to the new GsPlugin lifecycle
- Date: Wed, 13 Oct 2021 12:39:53 +0000 (UTC)
commit 861edb0780891c55fc2937ebdb66f018fe3a76b5
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu May 20 20:26:47 2021 +0100
gs-plugin-hardcoded-blocklist: Port to the new GsPlugin lifecycle
Signed-off-by: Philip Withnall <pwithnall endlessos org>
plugins/core/gs-plugin-hardcoded-blocklist.c | 26 +++++++++++++++++++++++---
plugins/core/gs-plugin-hardcoded-blocklist.h | 22 ++++++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
---
diff --git a/plugins/core/gs-plugin-hardcoded-blocklist.c b/plugins/core/gs-plugin-hardcoded-blocklist.c
index f993535de..036430395 100644
--- a/plugins/core/gs-plugin-hardcoded-blocklist.c
+++ b/plugins/core/gs-plugin-hardcoded-blocklist.c
@@ -11,16 +11,25 @@
#include <fnmatch.h>
#include <gnome-software.h>
+#include "gs-plugin-hardcoded-blocklist.h"
+
/*
* SECTION:
* Blocklists some applications based on a hardcoded list.
*/
-void
-gs_plugin_initialize (GsPlugin *plugin)
+struct _GsPluginHardcodedBlocklist
+{
+ GsPlugin parent;
+};
+
+G_DEFINE_TYPE (GsPluginHardcodedBlocklist, gs_plugin_hardcoded_blocklist, GS_TYPE_PLUGIN)
+
+static void
+gs_plugin_hardcoded_blocklist_init (GsPluginHardcodedBlocklist *self)
{
/* need ID */
- gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_AFTER, "appstream");
+ gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "appstream");
}
static gboolean
@@ -76,3 +85,14 @@ gs_plugin_refine (GsPlugin *plugin,
return TRUE;
}
+
+static void
+gs_plugin_hardcoded_blocklist_class_init (GsPluginHardcodedBlocklistClass *klass)
+{
+}
+
+GType
+gs_plugin_query_type (void)
+{
+ return GS_TYPE_PLUGIN_HARDCODED_BLOCKLIST;
+}
diff --git a/plugins/core/gs-plugin-hardcoded-blocklist.h b/plugins/core/gs-plugin-hardcoded-blocklist.h
new file mode 100644
index 000000000..fceef624e
--- /dev/null
+++ b/plugins/core/gs-plugin-hardcoded-blocklist.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_HARDCODED_BLOCKLIST (gs_plugin_hardcoded_blocklist_get_type ())
+
+G_DECLARE_FINAL_TYPE (GsPluginHardcodedBlocklist, gs_plugin_hardcoded_blocklist, GS,
PLUGIN_HARDCODED_BLOCKLIST, GsPlugin)
+
+G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]