[gnome-software: 4/5] gs-plugin-event: Drop unused setter functions
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 4/5] gs-plugin-event: Drop unused setter functions
- Date: Wed, 2 Feb 2022 16:12:50 +0000 (UTC)
commit 0b9dd2d5315e8f305ca01e1a9eac486247c5f759
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Jan 31 18:40:39 2022 +0000
gs-plugin-event: Drop unused setter functions
Signed-off-by: Philip Withnall <pwithnall endlessos org>
lib/gs-plugin-event.c | 77 ++++-----------------------------------------------
lib/gs-plugin-event.h | 9 ------
2 files changed, 5 insertions(+), 81 deletions(-)
---
diff --git a/lib/gs-plugin-event.c b/lib/gs-plugin-event.c
index 88d7b283d..8f86cfdce 100644
--- a/lib/gs-plugin-event.c
+++ b/lib/gs-plugin-event.c
@@ -51,24 +51,6 @@ typedef enum {
static GParamSpec *props[PROP_ERROR + 1] = { NULL, };
-/**
- * gs_plugin_event_set_app:
- * @event: A #GsPluginEvent
- * @app: A #GsApp
- *
- * Set the application (or source, or whatever component) that caused the event
- * to be created.
- *
- * Since: 3.22
- **/
-void
-gs_plugin_event_set_app (GsPluginEvent *event, GsApp *app)
-{
- g_return_if_fail (GS_IS_PLUGIN_EVENT (event));
- g_return_if_fail (GS_IS_APP (app));
- g_set_object (&event->app, app);
-}
-
/**
* gs_plugin_event_get_app:
* @event: A #GsPluginEvent
@@ -86,23 +68,6 @@ gs_plugin_event_get_app (GsPluginEvent *event)
return event->app;
}
-/**
- * gs_plugin_event_set_origin:
- * @event: A #GsPluginEvent
- * @origin: A #GsApp
- *
- * Set the origin that caused the event to be created.
- *
- * Since: 3.22
- **/
-void
-gs_plugin_event_set_origin (GsPluginEvent *event, GsApp *origin)
-{
- g_return_if_fail (GS_IS_PLUGIN_EVENT (event));
- g_return_if_fail (GS_IS_APP (origin));
- g_set_object (&event->origin, origin);
-}
-
/**
* gs_plugin_event_get_origin:
* @event: A #GsPluginEvent
@@ -120,22 +85,6 @@ gs_plugin_event_get_origin (GsPluginEvent *event)
return event->origin;
}
-/**
- * gs_plugin_event_set_action:
- * @event: A #GsPluginEvent
- * @action: A #GsPluginAction, e.g. %GS_PLUGIN_ACTION_UPDATE
- *
- * Set the action that caused the event to be created.
- *
- * Since: 3.22
- **/
-void
-gs_plugin_event_set_action (GsPluginEvent *event, GsPluginAction action)
-{
- g_return_if_fail (GS_IS_PLUGIN_EVENT (event));
- event->action = action;
-}
-
/**
* gs_plugin_event_get_action:
* @event: A #GsPluginEvent
@@ -247,26 +196,6 @@ gs_plugin_event_has_flag (GsPluginEvent *event, GsPluginEventFlag flag)
return ((event->flags & flag) > 0);
}
-/**
- * gs_plugin_event_set_error:
- * @event: A #GsPluginEvent
- * @error: A #GError
- *
- * Sets the event error.
- *
- * Since: 3.22
- **/
-void
-gs_plugin_event_set_error (GsPluginEvent *event, const GError *error)
-{
- g_clear_error (&event->error);
- event->error = g_error_copy (error);
- if (event->error) {
- /* Just in case the caller left there any D-Bus remote error notes */
- g_dbus_error_strip_remote_error (event->error);
- }
-}
-
/**
* gs_plugin_event_get_error:
* @event: A #GsPluginEvent
@@ -340,7 +269,11 @@ gs_plugin_event_set_property (GObject *object,
case PROP_ERROR:
/* Construct only. */
g_assert (self->error == NULL);
- gs_plugin_event_set_error (self, g_value_get_boxed (value));
+ self->error = g_value_dup_boxed (value);
+ if (self->error) {
+ /* Just in case the caller left there any D-Bus remote error notes */
+ g_dbus_error_strip_remote_error (self->error);
+ }
g_object_notify_by_pspec (object, props[prop_id]);
break;
default:
diff --git a/lib/gs-plugin-event.h b/lib/gs-plugin-event.h
index bdad7b9eb..d6107e809 100644
--- a/lib/gs-plugin-event.h
+++ b/lib/gs-plugin-event.h
@@ -43,18 +43,9 @@ GsPluginEvent *gs_plugin_event_new (const gchar
*first_property_name,
const gchar *gs_plugin_event_get_unique_id (GsPluginEvent *event);
-void gs_plugin_event_set_app (GsPluginEvent *event,
- GsApp *app);
GsApp *gs_plugin_event_get_app (GsPluginEvent *event);
-void gs_plugin_event_set_origin (GsPluginEvent *event,
- GsApp *origin);
GsApp *gs_plugin_event_get_origin (GsPluginEvent *event);
-void gs_plugin_event_set_action (GsPluginEvent *event,
- GsPluginAction action);
GsPluginAction gs_plugin_event_get_action (GsPluginEvent *event);
-
-void gs_plugin_event_set_error (GsPluginEvent *event,
- const GError *error);
const GError *gs_plugin_event_get_error (GsPluginEvent *event);
void gs_plugin_event_add_flag (GsPluginEvent *event,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]