mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-04-24 16:10:43 +02:00
linux: Move functions
No functional changes.
This commit is contained in:
parent
fa23d1be0c
commit
4496ebeb0a
1 changed files with 22 additions and 22 deletions
|
|
@ -93,6 +93,28 @@ input_switch_changed_cb (UpInput *input,
|
|||
up_daemon_set_lid_is_closed (backend->priv->daemon, switch_value);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
is_macbook (gpointer data)
|
||||
{
|
||||
char *product;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
product = sysfs_get_string ("/sys/devices/virtual/dmi/id/", "product_name");
|
||||
if (product == NULL)
|
||||
return GINT_TO_POINTER(ret);
|
||||
ret = g_str_has_prefix (product, "MacBook");
|
||||
g_free (product);
|
||||
return GINT_TO_POINTER(ret);
|
||||
}
|
||||
|
||||
gboolean
|
||||
up_backend_needs_poll_after_uevent (void)
|
||||
{
|
||||
static GOnce dmi_once = G_ONCE_INIT;
|
||||
g_once (&dmi_once, is_macbook, NULL);
|
||||
return GPOINTER_TO_INT(dmi_once.retval);
|
||||
}
|
||||
|
||||
static UpDevice *
|
||||
up_backend_device_new (UpBackend *backend, GUdevDevice *native)
|
||||
{
|
||||
|
|
@ -281,28 +303,6 @@ up_backend_uevent_signal_handler_cb (GUdevClient *client, const gchar *action,
|
|||
}
|
||||
}
|
||||
|
||||
static gpointer
|
||||
is_macbook (gpointer data)
|
||||
{
|
||||
char *product;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
product = sysfs_get_string ("/sys/devices/virtual/dmi/id/", "product_name");
|
||||
if (product == NULL)
|
||||
return GINT_TO_POINTER(ret);
|
||||
ret = g_str_has_prefix (product, "MacBook");
|
||||
g_free (product);
|
||||
return GINT_TO_POINTER(ret);
|
||||
}
|
||||
|
||||
gboolean
|
||||
up_backend_needs_poll_after_uevent (void)
|
||||
{
|
||||
static GOnce dmi_once = G_ONCE_INIT;
|
||||
g_once (&dmi_once, is_macbook, NULL);
|
||||
return GPOINTER_TO_INT(dmi_once.retval);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_battery_iface_proxy (GDBusProxy *interface_proxy)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue