mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 12:30:17 +00:00
trivial: Pass the FwupdClient to fu_util_device_to_string()
This will be useful for future code that needs the system state for translated messages, e.g. system battery level.
This commit is contained in:
parent
714a87771d
commit
09c703638f
@ -1961,7 +1961,8 @@ fu_util_self_sign(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
static void
|
||||
fu_util_device_added_cb(FwupdClient *client, FwupdDevice *device, gpointer user_data)
|
||||
{
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(device, 0);
|
||||
FuUtilPrivate *priv = (FuUtilPrivate *)user_data;
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(priv->client, device, 0);
|
||||
/* TRANSLATORS: this is when a device is hotplugged */
|
||||
g_print("%s\n%s", _("Device added:"), tmp);
|
||||
}
|
||||
@ -1969,7 +1970,8 @@ fu_util_device_added_cb(FwupdClient *client, FwupdDevice *device, gpointer user_
|
||||
static void
|
||||
fu_util_device_removed_cb(FwupdClient *client, FwupdDevice *device, gpointer user_data)
|
||||
{
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(device, 0);
|
||||
FuUtilPrivate *priv = (FuUtilPrivate *)user_data;
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(priv->client, device, 0);
|
||||
/* TRANSLATORS: this is when a device is hotplugged */
|
||||
g_print("%s\n%s", _("Device removed:"), tmp);
|
||||
}
|
||||
@ -1977,7 +1979,8 @@ fu_util_device_removed_cb(FwupdClient *client, FwupdDevice *device, gpointer use
|
||||
static void
|
||||
fu_util_device_changed_cb(FwupdClient *client, FwupdDevice *device, gpointer user_data)
|
||||
{
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(device, 0);
|
||||
FuUtilPrivate *priv = (FuUtilPrivate *)user_data;
|
||||
g_autofree gchar *tmp = fu_util_device_to_string(priv->client, device, 0);
|
||||
/* TRANSLATORS: this is when a device has been updated */
|
||||
g_print("%s\n%s", _("Device changed:"), tmp);
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ fu_util_traverse_tree(GNode *n, gpointer data)
|
||||
/* get split lines */
|
||||
if (FWUPD_IS_DEVICE(n->data)) {
|
||||
FwupdDevice *dev = FWUPD_DEVICE(n->data);
|
||||
tmp = fu_util_device_to_string(dev, idx);
|
||||
tmp = fu_util_device_to_string(client, dev, idx);
|
||||
} else if (FWUPD_IS_REMOTE(n->data)) {
|
||||
FwupdRemote *remote = FWUPD_REMOTE(n->data);
|
||||
tmp = fu_util_remote_to_string(remote, idx);
|
||||
@ -1305,7 +1305,7 @@ fu_util_update_state_to_string(FwupdUpdateState update_state)
|
||||
}
|
||||
|
||||
gchar *
|
||||
fu_util_device_to_string(FwupdDevice *dev, guint idt)
|
||||
fu_util_device_to_string(FwupdClient *client, FwupdDevice *dev, guint idt)
|
||||
{
|
||||
FwupdUpdateState state;
|
||||
GPtrArray *guids = fwupd_device_get_guids(dev);
|
||||
|
@ -112,7 +112,7 @@ gchar *
|
||||
fu_util_time_to_str(guint64 tmp);
|
||||
|
||||
gchar *
|
||||
fu_util_device_to_string(FwupdDevice *dev, guint idt);
|
||||
fu_util_device_to_string(FwupdClient *client, FwupdDevice *dev, guint idt);
|
||||
gchar *
|
||||
fu_util_plugin_to_string(FwupdPlugin *plugin, guint idt);
|
||||
const gchar *
|
||||
|
@ -1753,7 +1753,7 @@ fu_util_get_results(FuUtilPrivate *priv, gchar **values, GError **error)
|
||||
return FALSE;
|
||||
if (priv->as_json)
|
||||
return fu_util_get_results_as_json(priv, rel, error);
|
||||
tmp = fu_util_device_to_string(rel, 0);
|
||||
tmp = fu_util_device_to_string(priv->client, rel, 0);
|
||||
g_print("%s", tmp);
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user