trivial: Export fu_device_set_quirk_kv() for future use

This seems like a useful thing regardless.
This commit is contained in:
Richard Hughes 2022-09-07 14:24:28 +01:00
parent b0ccde5b27
commit 1d308b2361
3 changed files with 22 additions and 1 deletions

View File

@ -56,3 +56,5 @@ FuDeviceInternalFlags
fu_device_get_internal_flags(FuDevice *self);
void
fu_device_set_internal_flags(FuDevice *self, FuDeviceInternalFlags flags);
gboolean
fu_device_set_quirk_kv(FuDevice *self, const gchar *key, const gchar *value, GError **error);

View File

@ -1619,13 +1619,31 @@ fu_device_set_quirk_inhibit_section(FuDevice *self, const gchar *value, GError *
return TRUE;
}
static gboolean
/**
* fu_device_set_quirk_kv:
* @self: a #FuDevice
* @key: a string key
* @value: a string value
* @error: (nullable): optional return location for an error
*
* Sets a specific quirk on the device.
*
* Returns: %TRUE on success
*
* Since: 1.8.5
**/
gboolean
fu_device_set_quirk_kv(FuDevice *self, const gchar *key, const gchar *value, GError **error)
{
FuDevicePrivate *priv = GET_PRIVATE(self);
FuDeviceClass *klass = FU_DEVICE_GET_CLASS(self);
guint64 tmp;
g_return_val_if_fail(FU_IS_DEVICE(self), FALSE);
g_return_val_if_fail(key != NULL, FALSE);
g_return_val_if_fail(value != NULL, FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
if (g_strcmp0(key, FU_QUIRKS_PLUGIN) == 0) {
g_auto(GStrv) sections = g_strsplit(value, ",", -1);
for (guint i = 0; sections[i] != NULL; i++)

View File

@ -1098,6 +1098,7 @@ LIBFWUPDPLUGIN_1.8.4 {
LIBFWUPDPLUGIN_1.8.5 {
global:
fu_device_set_quirk_kv;
fu_intel_thunderbolt_firmware_get_type;
fu_intel_thunderbolt_firmware_new;
fu_intel_thunderbolt_nvm_get_device_id;