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.
This commit is contained in:
Kate Hsuan 2024-02-26 16:59:48 +08:00
parent 6ef7fcd1bd
commit ab50a2bb3e
2 changed files with 15 additions and 0 deletions

View file

@ -870,6 +870,20 @@ up_history_set_time_empty_data (UpHistory *history, gint64 time_s)
return TRUE;
}
/**
* 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

View file

@ -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,