diff options
author | Kate Hsuan <hpa@redhat.com> | 2024-02-26 16:59:48 +0800 |
---|---|---|
committer | Kate Hsuan <hpa@redhat.com> | 2024-03-05 16:27:16 +0800 |
commit | ab50a2bb3ec87c4ac01351368dc09df6fa369866 (patch) | |
tree | aa7013f9602895e6b2b271dcd70363e8664f102c | |
parent | 6ef7fcd1bd5105b98ede460f18eed09c2fc41389 (diff) |
up-history: Compare the history id with a given string
up_history_is_device_id_equal() is used to compare the history device_id
with a given string.
-rw-r--r-- | src/up-history.c | 14 | ||||
-rw-r--r-- | src/up-history.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/up-history.c b/src/up-history.c index bed3b0e..2664fba 100644 --- a/src/up-history.c +++ b/src/up-history.c @@ -871,6 +871,20 @@ up_history_set_time_empty_data (UpHistory *history, gint64 time_s) } /** + * up_history_is_device_id_equal: + **/ +gboolean +up_history_is_device_id_equal(UpHistory *history, const gchar *id) +{ + g_return_val_if_fail (UP_IS_HISTORY (history), FALSE); + + if (!g_strcmp0 (history->priv->id, id)) + return TRUE; + + return FALSE; +} + +/** * up_history_class_init: * @klass: The UpHistoryClass **/ diff --git a/src/up-history.h b/src/up-history.h index 87af5e3..7b0c2bd 100644 --- a/src/up-history.h +++ b/src/up-history.h @@ -60,6 +60,7 @@ typedef enum { GType up_history_get_type (void); +gboolean up_history_is_device_id_equal (UpHistory *history, const gchar *id); UpHistory *up_history_new (void); GPtrArray *up_history_get_data (UpHistory *history, |