MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / battery_proxy_new_cb

Function battery_proxy_new_cb

gtk/src/power-manager.c:127–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static void
128battery_proxy_new_cb (GObject *source, GAsyncResult *result,
129 signal_user_data_t *ud)
130{
131 GDBusProxy *proxy;
132 GVariant *is_present;
133 GError *error = NULL;
134
135 proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
136 if (proxy != NULL)
137 {
138 is_present = g_dbus_proxy_get_cached_property(proxy, "IsPresent");
139 if (g_variant_get_boolean(is_present))
140 {
141 g_signal_connect(proxy, "g-properties-changed",
142 G_CALLBACK(battery_level_cb), ud);
143 show_power_widgets(battery_widgets);
144 battery_proxy = proxy;
145 }
146 else
147 {
148 g_debug("No battery present. Disconnecting UPower proxy.");
149 g_clear_object(&proxy);
150 g_clear_object(&upower_proxy);
151 }
152 g_variant_unref(is_present);
153 }
154 else
155 {
156 g_debug("Could not get DisplayDevice proxy: %s", error->message);
157 g_error_free(error);
158 g_clear_object(&upower_proxy);
159 }
160}
161
162static void
163battery_proxy_new_async (signal_user_data_t *ud)

Callers

nothing calls this directly

Calls 1

show_power_widgetsFunction · 0.85

Tested by

no test coverage detected