trivial: Add a vfunc for setting the quirk KVs in derived objects

This commit is contained in:
Richard Hughes 2018-08-29 09:07:29 +01:00
parent 163947bd5f
commit 168a209a14
2 changed files with 9 additions and 1 deletions

View File

@ -562,6 +562,10 @@ fu_device_set_quirk_kv (FuDevice *device,
return TRUE; return TRUE;
} }
/* optional device-specific method */
if (klass->set_quirk_kv != NULL)
return klass->set_quirk_kv (device, key, value, error);
/* failed */ /* failed */
g_set_error_literal (error, g_set_error_literal (error,
G_IO_ERROR, G_IO_ERROR,

View File

@ -40,8 +40,12 @@ struct _FuDeviceClass
GBytes *(*prepare_firmware) (FuDevice *device, GBytes *(*prepare_firmware) (FuDevice *device,
GBytes *fw, GBytes *fw,
GError **error); GError **error);
gboolean (*set_quirk_kv) (FuDevice *device,
const gchar *key,
const gchar *value,
GError **error);
/*< private >*/ /*< private >*/
gpointer padding[24]; gpointer padding[23];
}; };
/** /**