mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-04 22:18:28 +02:00
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:
parent
6ef7fcd1bd
commit
ab50a2bb3e
2 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue