libfwupd: Add fwupd_client_get_user_agent()

If we set a property, we should probably have a way to read it back...
This commit is contained in:
Richard Hughes 2020-11-17 16:49:49 +00:00
parent 42577728bb
commit eba28b6520
3 changed files with 27 additions and 0 deletions

View File

@ -3861,6 +3861,26 @@ fwupd_client_set_user_agent (FwupdClient *self, const gchar *user_agent)
priv->user_agent = g_strdup (user_agent);
}
/**
* fwupd_client_get_user_agent:
* @self: A #FwupdClient
*
* Gets the string that represents the user agent that is used for
* uploading and downloading. The user agent will contain the runtime
* version of fwupd somewhere in the provided string.
*
* Returns: a string, or %NULL for unknown.
*
* Since: 1.5.2
**/
const gchar *
fwupd_client_get_user_agent (FwupdClient *self)
{
FwupdClientPrivate *priv = GET_PRIVATE (self);
g_return_val_if_fail (FWUPD_IS_CLIENT (self), NULL);
return priv->user_agent;
}
/**
* fwupd_client_set_user_agent_for_package:
* @self: A #FwupdClient

View File

@ -355,6 +355,7 @@ void fwupd_client_set_feature_flags_async (FwupdClient *self,
gboolean fwupd_client_set_feature_flags_finish (FwupdClient *self,
GAsyncResult *res,
GError **error);
const gchar *fwupd_client_get_user_agent (FwupdClient *self);
void fwupd_client_set_user_agent (FwupdClient *self,
const gchar *user_agent);
void fwupd_client_set_user_agent_for_package(FwupdClient *self,

View File

@ -616,3 +616,9 @@ LIBFWUPD_1.5.1 {
fwupd_device_add_child;
local: *;
} LIBFWUPD_1.5.0;
LIBFWUPD_1.5.2 {
global:
fwupd_client_get_user_agent;
local: *;
} LIBFWUPD_1.5.1;