[SCM] mate-power-manager Debian package branch, master, updated. debian/1.8.0+dfsg1-2-3-gdba25bc
Mike Gabriel
sunweaver at moszumanska.debian.org
Fri May 30 12:23:41 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-mate/mate-power-manager.git;a=commitdiff;h=dba25bc
The following commit has been merged in the master branch:
commit dba25bca8844f3783117a9c56bb58a4d3b48f070
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Fri May 30 14:12:38 2014 +0200
debian/patches: Pull-in three upstream-commits as patches (0001_upower-1.0_patch[1-3].patch). Fix FTBFS against upower (>= 0.99). (Closes: #748931).
---
debian/patches/0001_upower-1.0_patch1.patch | 377 ++++++++++++++++++++++++++++
debian/patches/0001_upower-1.0_patch2.patch | 103 ++++++++
debian/patches/0001_upower-1.0_patch3.patch | 217 ++++++++++++++++
debian/patches/series | 3 +
4 files changed, 700 insertions(+)
diff --git a/debian/patches/0001_upower-1.0_patch1.patch b/debian/patches/0001_upower-1.0_patch1.patch
new file mode 100644
index 0000000..be7787b
--- /dev/null
+++ b/debian/patches/0001_upower-1.0_patch1.patch
@@ -0,0 +1,377 @@
+Description: Port mate-power-manager to upower-0.99 API (patch 1)
+Author: Stefan Seyfried <seife+dev at b1-systems.com>
+Origin: http://git.mate-desktop.org/mate-power-manager/patch/?id=d59f4b8bd38e1628af3a992ae8e96b8e069ab738
+---
+--- a/src/gpm-backlight.c
++++ b/src/gpm-backlight.c
+@@ -410,7 +410,11 @@
+ * Does the actions when the ac power source is inserted/removed.
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_backlight_client_changed_cb (UpClient *client, GParamSpec *pspec, GpmBacklight *backlight)
++#else
+ gpm_backlight_client_changed_cb (UpClient *client, GpmBacklight *backlight)
++#endif
+ {
+ gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, TRUE);
+ }
+@@ -727,8 +731,13 @@
+
+ /* we use up_client for the ac-adapter-changed signal */
+ backlight->priv->client = up_client_new ();
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (backlight->priv->client, "notify",
++ G_CALLBACK (gpm_backlight_client_changed_cb), backlight);
++#else
+ g_signal_connect (backlight->priv->client, "changed",
+ G_CALLBACK (gpm_backlight_client_changed_cb), backlight);
++#endif
+
+ /* gets caps */
+ backlight->priv->can_dim = gpm_brightness_has_hw (backlight->priv->brightness);
+--- a/src/gpm-button.c
++++ b/src/gpm-button.c
+@@ -324,7 +324,11 @@
+ * gpm_button_client_changed_cb
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_button_client_changed_cb (UpClient *client, GParamSpec *pspec, GpmButton *button)
++#else
+ gpm_button_client_changed_cb (UpClient *client, GpmButton *button)
++#endif
+ {
+ gboolean lid_is_closed;
+
+@@ -363,9 +367,13 @@
+
+ button->priv->client = up_client_new ();
+ button->priv->lid_is_closed = up_client_get_lid_is_closed (button->priv->client);
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (button->priv->client, "notify",
++ G_CALLBACK (gpm_button_client_changed_cb), button);
++#else
+ g_signal_connect (button->priv->client, "changed",
+ G_CALLBACK (gpm_button_client_changed_cb), button);
+-
++#endif
+ /* register the brightness keys */
+ gpm_button_xevent_key (button, XF86XK_PowerOff, GPM_BUTTON_POWER);
+ #ifdef HAVE_XF86XK_SUSPEND
+--- a/src/gpm-control.c
++++ b/src/gpm-control.c
+@@ -289,10 +289,11 @@
+ }
+ g_object_unref(proxy);
+ }
++#if !UP_CHECK_VERSION(0, 99, 0)
+ else {
+ ret = up_client_suspend_sync (control->priv->client, NULL, error);
+ }
+-
++#endif
+ egg_debug ("emitting resume");
+ g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_SUSPEND);
+
+@@ -399,10 +400,11 @@
+ ret = TRUE;
+ }
+ }
++#if !UP_CHECK_VERSION(0, 99, 0)
+ else {
+ ret = up_client_hibernate_sync (control->priv->client, NULL, error);
+ }
+-
++#endif
+ egg_debug ("emitting resume");
+ g_signal_emit (control, signals [RESUME], 0, GPM_CONTROL_ACTION_HIBERNATE);
+
+--- a/src/gpm-engine.c
++++ b/src/gpm-engine.c
+@@ -805,12 +805,14 @@
+ guint i;
+ GPtrArray *array = NULL;
+ UpDevice *device;
++#if !UP_CHECK_VERSION(0, 99, 0)
+ gboolean ret;
+ GError *error = NULL;
++#endif
+
+ g_return_val_if_fail (engine != NULL, FALSE);
+ g_return_val_if_fail (GPM_IS_ENGINE (engine), FALSE);
+-
++#if !UP_CHECK_VERSION(0, 99, 0)
+ /* get devices from UPower */
+ ret = up_client_enumerate_devices_sync (engine->priv->client, NULL, &error);
+ if (!ret) {
+@@ -818,7 +820,7 @@
+ g_error_free (error);
+ goto out;
+ }
+-
++#endif
+ /* connected mobile phones */
+ gpm_phone_coldplug (engine->priv->phone);
+
+@@ -831,7 +833,9 @@
+ gpm_engine_device_add (engine, device);
+ gpm_engine_check_recall (engine, device);
+ }
++#if !UP_CHECK_VERSION(0, 99, 0)
+ out:
++#endif
+ if (array != NULL)
+ g_ptr_array_unref (array);
+ /* never repeat */
+@@ -855,6 +859,22 @@
+ * gpm_engine_device_removed_cb:
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_engine_device_removed_cb (UpClient *client, const char *object_path, GpmEngine *engine)
++{
++ guint i;
++
++ for (i = 0; i < engine->priv->array->len; i++) {
++ UpDevice *device = g_ptr_array_index (engine->priv->array, i);
++
++ if (g_strcmp0 (object_path, up_device_get_object_path (device)) == 0) {
++ g_ptr_array_remove_index (engine->priv->array, i);
++ break;
++ }
++ }
++ gpm_engine_recalculate_state (engine);
++}
++#else
+ gpm_engine_device_removed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
+ {
+ gboolean ret;
+@@ -863,12 +883,18 @@
+ return;
+ gpm_engine_recalculate_state (engine);
+ }
+-
++#endif
+
+ /**
+ * gpm_engine_device_changed_cb:
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_engine_device_changed_cb (UpClient *client, GParamSpec *pspec, GpmEngine *engine)
++{
++ gpm_engine_recalculate_state (engine);
++}
++#else
+ gpm_engine_device_changed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
+ {
+ UpDeviceKind kind;
+@@ -930,6 +956,7 @@
+
+ gpm_engine_recalculate_state (engine);
+ }
++#endif
+
+ /**
+ * gpm_engine_get_devices:
+@@ -1042,7 +1069,10 @@
+ static void
+ gpm_engine_init (GpmEngine *engine)
+ {
+-
++#if UP_CHECK_VERSION(0, 99, 0)
++ GPtrArray *array = NULL;
++ guint i;
++#endif
+ engine->priv = GPM_ENGINE_GET_PRIVATE (engine);
+
+ engine->priv->array = g_ptr_array_new_with_free_func (g_object_unref);
+@@ -1051,8 +1081,13 @@
+ G_CALLBACK (gpm_engine_device_added_cb), engine);
+ g_signal_connect (engine->priv->client, "device-removed",
+ G_CALLBACK (gpm_engine_device_removed_cb), engine);
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (engine->priv->client, "notify",
++ G_CALLBACK (gpm_engine_device_changed_cb), engine);
++#else
+ g_signal_connect (engine->priv->client, "device-changed",
+ G_CALLBACK (gpm_engine_device_changed_cb), engine);
++#endif
+
+ engine->priv->settings = g_settings_new (GPM_SETTINGS_SCHEMA);
+ g_signal_connect (engine->priv->settings, "changed",
+@@ -1066,6 +1101,18 @@
+ g_signal_connect (engine->priv->phone, "device-refresh",
+ G_CALLBACK (phone_device_refresh_cb), engine);
+
++#if UP_CHECK_VERSION(0, 99, 0)
++ /* coldplug */
++ array = up_client_get_devices(engine->priv->client);
++ if (array) {
++ for (i = 0; i < array->len; i++) {
++ UpDevice *device = g_ptr_array_index (array, i);
++ gpm_engine_device_added_cb(engine->priv->client, device, engine);
++ }
++ g_ptr_array_free (array, TRUE);
++ }
++#endif
++
+ /* create a fake virtual composite battery */
+ engine->priv->battery_composite = up_device_new ();
+ g_object_set (engine->priv->battery_composite,
+--- a/src/gpm-kbd-backlight.c
++++ b/src/gpm-kbd-backlight.c
+@@ -532,6 +532,9 @@
+ **/
+ static void
+ gpm_kbd_backlight_client_changed_cb (UpClient *client,
++#if UP_CHECK_VERSION(0, 99, 0)
++ GParamSpec *pspec,
++#endif
+ GpmKbdBacklight *backlight)
+ {
+ gpm_kbd_backlight_evaluate_power_source_and_set (backlight);
+@@ -801,8 +804,13 @@
+
+ /* Use upower for ac changed signal */
+ backlight->priv->client = up_client_new ();
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (backlight->priv->client, "notify",
++ G_CALLBACK (gpm_kbd_backlight_client_changed_cb), backlight);
++#else
+ g_signal_connect (backlight->priv->client, "changed",
+ G_CALLBACK (gpm_kbd_backlight_client_changed_cb), backlight);
++#endif
+
+ backlight->priv->settings = g_settings_new (GPM_SETTINGS_SCHEMA);
+ //g_signal_connect (backlight->priv->settings, "changed", G_CALLBACK (gpm_settings_key_changed_cb), backlight);
+--- a/src/gpm-manager.c
++++ b/src/gpm-manager.c
+@@ -971,7 +971,11 @@
+ * gpm_manager_client_changed_cb:
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_manager_client_changed_cb (UpClient *client, GParamSpec *pspec, GpmManager *manager)
++#else
+ gpm_manager_client_changed_cb (UpClient *client, GpmManager *manager)
++#endif
+ {
+ gboolean event_when_closed;
+ gint timeout;
+@@ -1958,8 +1962,13 @@
+ g_signal_connect (manager->priv->settings, "changed",
+ G_CALLBACK (gpm_manager_settings_changed_cb), manager);
+ manager->priv->client = up_client_new ();
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (manager->priv->client, "notify",
++ G_CALLBACK (gpm_manager_client_changed_cb), manager);
++#else
+ g_signal_connect (manager->priv->client, "changed",
+ G_CALLBACK (gpm_manager_client_changed_cb), manager);
++#endif
+
+ /* use libmatenotify */
+ notify_init (GPM_NAME);
+--- a/src/gpm-prefs-core.c
++++ b/src/gpm-prefs-core.c
+@@ -811,7 +811,9 @@
+ UpDevice *device;
+ UpDeviceKind kind;
+ GpmBrightness *brightness;
++#if !UP_CHECK_VERSION(0, 99, 0)
+ gboolean ret;
++#endif
+ guint i;
+
+ GDBusProxy *proxy;
+@@ -897,9 +899,11 @@
+ else {
+ /* are we allowed to shutdown? */
+ egg_console_kit_can_stop (prefs->priv->console, &prefs->priv->can_shutdown, NULL);
++#if !UP_CHECK_VERSION(0, 99, 0)
+ /* get values from UpClient */
+ prefs->priv->can_suspend = up_client_get_can_suspend (prefs->priv->client);
+ prefs->priv->can_hibernate = up_client_get_can_hibernate (prefs->priv->client);
++#endif
+ }
+
+ if (LOGIND_RUNNING()) {
+@@ -953,14 +957,14 @@
+ brightness = gpm_brightness_new ();
+ prefs->priv->has_lcd = gpm_brightness_has_hw (brightness);
+ g_object_unref (brightness);
+-
++#if !UP_CHECK_VERSION(0, 99, 0)
+ /* get device list */
+ ret = up_client_enumerate_devices_sync (prefs->priv->client, NULL, &error);
+ if (!ret) {
+ egg_warning ("failed to get device list: %s", error->message);
+ g_error_free (error);
+ }
+-
++#endif
+ devices = up_client_get_devices (prefs->priv->client);
+ for (i=0; i<devices->len; i++) {
+ device = g_ptr_array_index (devices, i);
+--- a/src/gpm-statistics.c
++++ b/src/gpm-statistics.c
+@@ -1236,6 +1236,12 @@
+ * gpm_stats_device_changed_cb:
+ **/
+ static void
++#if UP_CHECK_VERSION(0, 99, 0)
++gpm_stats_device_changed_cb (UpClient *client, GParamSpec *pspec, gpointer user_data)
++{
++ gpm_stats_button_update_ui();
++}
++#else
+ gpm_stats_device_changed_cb (UpClient *client, UpDevice *device, gpointer user_data)
+ {
+ const gchar *object_path;
+@@ -1246,6 +1252,7 @@
+ if (g_strcmp0 (current_device, object_path) == 0)
+ gpm_stats_update_info_data (device);
+ }
++#endif
+
+ /**
+ * gpm_stats_device_removed_cb:
+@@ -1794,11 +1801,12 @@
+
+ wakeups = up_wakeups_new ();
+ g_signal_connect (wakeups, "data-changed", G_CALLBACK (gpm_stats_data_changed_cb), NULL);
+-
++#if !UP_CHECK_VERSION(0, 99, 0)
+ /* coldplug */
+ ret = up_client_enumerate_devices_sync (client, NULL, NULL);
+ if (!ret)
+ goto out;
++#endif
+ devices = up_client_get_devices (client);
+
+ /* add devices in visually pleasing order */
+@@ -1814,7 +1822,11 @@
+ /* connect now the coldplug is done */
+ g_signal_connect (client, "device-added", G_CALLBACK (gpm_stats_device_added_cb), NULL);
+ g_signal_connect (client, "device-removed", G_CALLBACK (gpm_stats_device_removed_cb), NULL);
++#if UP_CHECK_VERSION(0, 99, 0)
++ g_signal_connect (client, "notify", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
++#else
+ g_signal_connect (client, "device-changed", G_CALLBACK (gpm_stats_device_changed_cb), NULL);
++#endif
+
+ /* set current device */
+ if (devices->len > 0) {
+@@ -1854,8 +1866,9 @@
+ gtk_widget_show (widget);
+
+ gtk_main ();
+-
++#if !UP_CHECK_VERSION(0, 99, 0)
+ out:
++#endif
+ g_object_unref (settings);
+ g_object_unref (client);
+ g_object_unref (wakeups);
diff --git a/debian/patches/0001_upower-1.0_patch2.patch b/debian/patches/0001_upower-1.0_patch2.patch
new file mode 100644
index 0000000..e7ca506
--- /dev/null
+++ b/debian/patches/0001_upower-1.0_patch2.patch
@@ -0,0 +1,103 @@
+Description: Port mate-power-manager to upower-0.99 API (patch 2)
+Author: Stefano Karapetsas <stefano at karapetsas.com>
+Origin: http://git.mate-desktop.org/mate-power-manager/patch/?id=1fb28703f76a97421f3554d5c553b06707f890a7
+---
+--- a/src/gpm-engine.c
++++ b/src/gpm-engine.c
+@@ -83,6 +83,9 @@
+
+ static UpDevice *gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device);
+ static UpDevice *gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device);
++#if UP_CHECK_VERSION (0, 99, 0)
++static void gpm_engine_device_changed_cb (UpDevice *device, GParamSpec *pspec, GpmEngine *engine);
++#endif
+
+ typedef enum {
+ GPM_ENGINE_WARNING_NONE = 0,
+@@ -758,6 +761,13 @@
+ g_object_get (composite, "state", &state, NULL);
+ g_object_set_data (G_OBJECT(composite), "engine-state-old", GUINT_TO_POINTER(state));
+ }
++
++#if UP_CHECK_VERSION (0, 99, 0)
++ if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_UPS || kind == UP_DEVICE_KIND_LINE_POWER)
++ return;
++ g_signal_connect (device, "notify", G_CALLBACK (gpm_engine_device_changed_cb), engine);
++#endif
++
+ }
+
+ /**
+@@ -890,19 +900,20 @@
+ **/
+ static void
+ #if UP_CHECK_VERSION(0, 99, 0)
+-gpm_engine_device_changed_cb (UpClient *client, GParamSpec *pspec, GpmEngine *engine)
+-{
+- gpm_engine_recalculate_state (engine);
+-}
++gpm_engine_device_changed_cb (UpDevice *device, GParamSpec *pspec, GpmEngine *engine)
+ #else
+ gpm_engine_device_changed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
++#endif
+ {
++#if !UP_CHECK_VERSION(0, 99, 0)
+ UpDeviceKind kind;
++#endif
+ UpDeviceState state;
+ UpDeviceState state_old;
+ GpmEngineWarning warning_old;
+ GpmEngineWarning warning;
+
++#if !UP_CHECK_VERSION(0, 99, 0)
+ /* get device properties */
+ g_object_get (device,
+ "kind", &kind,
+@@ -913,6 +924,7 @@
+ egg_debug ("updating because %s changed", up_device_get_object_path (device));
+ device = gpm_engine_update_composite_device (engine, device);
+ }
++#endif
+
+ /* get device properties (may be composite) */
+ g_object_get (device,
+@@ -956,7 +968,6 @@
+
+ gpm_engine_recalculate_state (engine);
+ }
+-#endif
+
+ /**
+ * gpm_engine_get_devices:
+@@ -1081,10 +1092,7 @@
+ G_CALLBACK (gpm_engine_device_added_cb), engine);
+ g_signal_connect (engine->priv->client, "device-removed",
+ G_CALLBACK (gpm_engine_device_removed_cb), engine);
+-#if UP_CHECK_VERSION(0, 99, 0)
+- g_signal_connect (engine->priv->client, "notify",
+- G_CALLBACK (gpm_engine_device_changed_cb), engine);
+-#else
++#if !UP_CHECK_VERSION(0, 99, 0)
+ g_signal_connect (engine->priv->client, "device-changed",
+ G_CALLBACK (gpm_engine_device_changed_cb), engine);
+ #endif
+@@ -1114,6 +1122,11 @@
+ #endif
+
+ /* create a fake virtual composite battery */
++#if UP_CHECK_VERSION(0, 99, 0)
++ engine->priv->battery_composite = up_client_get_display_device (engine->priv->client);
++ g_signal_connect (engine->priv->client, "notify",
++ G_CALLBACK (gpm_engine_device_changed_cb), engine);
++#else
+ engine->priv->battery_composite = up_device_new ();
+ g_object_set (engine->priv->battery_composite,
+ "kind", UP_DEVICE_KIND_BATTERY,
+@@ -1122,6 +1135,7 @@
+ "power-supply", TRUE,
+ "is-present", TRUE,
+ NULL);
++#endif
+
+ engine->priv->previous_icon = NULL;
+ engine->priv->previous_summary = NULL;
diff --git a/debian/patches/0001_upower-1.0_patch3.patch b/debian/patches/0001_upower-1.0_patch3.patch
new file mode 100644
index 0000000..7730ac1
--- /dev/null
+++ b/debian/patches/0001_upower-1.0_patch3.patch
@@ -0,0 +1,217 @@
+Description: Port mate-power-manager to upower-0.99 API (patch 3)
+Author: Stefano Karapetsas <stefano at karapetsas.com>
+Origin: http://git.mate-desktop.org/mate-power-manager/patch/?id=8f734c679de61292f0ae1bd9923fc67801ab041c
+---
+--- a/src/gpm-engine.c
++++ b/src/gpm-engine.c
+@@ -85,7 +85,29 @@
+ static UpDevice *gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device);
+ #if UP_CHECK_VERSION (0, 99, 0)
+ static void gpm_engine_device_changed_cb (UpDevice *device, GParamSpec *pspec, GpmEngine *engine);
+-#endif
++
++#define GPM_ENGINE_WARNING_NONE UP_DEVICE_LEVEL_NONE
++#define GPM_ENGINE_WARNING_DISCHARGING UP_DEVICE_LEVEL_DISCHARGING
++#define GPM_ENGINE_WARNING_LOW UP_DEVICE_LEVEL_LOW
++#define GPM_ENGINE_WARNING_CRITICAL UP_DEVICE_LEVEL_CRITICAL
++#define GPM_ENGINE_WARNING_ACTION UP_DEVICE_LEVEL_ACTION
++
++/**
++ * gpm_engine_get_warning:
++ *
++ * This gets the possible engine state for the device according to the
++ * policy, which could be per-percent, or per-time.
++ *
++ * Return value: A GpmEngine state, e.g. GPM_ENGINE_WARNING_DISCHARGING
++ **/
++static UpDeviceLevel
++gpm_engine_get_warning (GpmEngine *engine, UpDevice *device)
++{
++ UpDeviceLevel warning;
++ g_object_get (device, "warning-level", &warning, NULL);
++ return warning;
++}
++#else
+
+ typedef enum {
+ GPM_ENGINE_WARNING_NONE = 0,
+@@ -227,6 +249,7 @@
+ out:
+ return warning_type;
+ }
++#endif
+
+ /**
+ * gpm_engine_get_summary:
+@@ -283,12 +306,20 @@
+ * Returns the icon
+ **/
+ static gchar *
++#if UP_CHECK_VERSION (0, 99, 0)
++gpm_engine_get_icon_priv (GpmEngine *engine, UpDeviceKind device_kind, UpDeviceLevel warning, gboolean use_state)
++#else
+ gpm_engine_get_icon_priv (GpmEngine *engine, UpDeviceKind device_kind, GpmEngineWarning warning, gboolean use_state)
++#endif
+ {
+ guint i;
+ GPtrArray *array;
+ UpDevice *device;
++#if UP_CHECK_VERSION (0, 99, 0)
++ UpDeviceLevel warning_temp;
++#else
+ GpmEngineWarning warning_temp;
++#endif
+ UpDeviceKind kind;
+ UpDeviceState state;
+ gboolean is_present;
+@@ -573,6 +604,9 @@
+ static UpDevice *
+ gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device)
+ {
++#if UP_CHECK_VERSION (0, 99, 0)
++ return engine->priv->battery_composite;
++#else
+ guint battery_devices = 0;
+ GPtrArray *array;
+ UpDevice *device;
+@@ -602,6 +636,7 @@
+ out:
+ /* return composite device or original device */
+ return device;
++#endif
+ }
+
+ /**
+@@ -610,6 +645,18 @@
+ static UpDevice *
+ gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device)
+ {
++#if UP_CHECK_VERSION (0, 99, 0)
++ gchar *text;
++
++ text = up_device_to_text (engine->priv->battery_composite);
++ egg_debug ("composite:
%s", text);
++ g_free (text);
++
++ /* force update of icon */
++ gpm_engine_recalculate_state_icon (engine);
++
++ return engine->priv->battery_composite;
++#else
+ guint i;
+ gdouble percentage = 0.0;
+ gdouble energy = 0.0;
+@@ -721,6 +768,7 @@
+ out:
+ /* return composite device or original device */
+ return device;
++#endif
+ }
+
+ /**
+@@ -729,7 +777,11 @@
+ static void
+ gpm_engine_device_add (GpmEngine *engine, UpDevice *device)
+ {
++#if UP_CHECK_VERSION (0, 99, 0)
++ UpDeviceLevel warning;
++#else
+ GpmEngineWarning warning;
++#endif
+ UpDeviceState state;
+ UpDeviceKind kind;
+ UpDevice *composite;
+@@ -763,9 +815,9 @@
+ }
+
+ #if UP_CHECK_VERSION (0, 99, 0)
+- if (kind == UP_DEVICE_KIND_BATTERY || kind == UP_DEVICE_KIND_UPS || kind == UP_DEVICE_KIND_LINE_POWER)
+- return;
+ g_signal_connect (device, "notify", G_CALLBACK (gpm_engine_device_changed_cb), engine);
++ g_ptr_array_add (engine->priv->array, g_object_ref (device));
++ gpm_engine_recalculate_state (engine);
+ #endif
+
+ }
+@@ -858,11 +910,15 @@
+ static void
+ gpm_engine_device_added_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
+ {
++#if UP_CHECK_VERSION (0, 99, 0)
++ gpm_engine_device_add (engine, device);
++#else
+ /* add to list */
+ g_ptr_array_add (engine->priv->array, g_object_ref (device));
+ gpm_engine_check_recall (engine, device);
+
+ gpm_engine_recalculate_state (engine);
++#endif
+ }
+
+ /**
+@@ -905,15 +961,17 @@
+ gpm_engine_device_changed_cb (UpClient *client, UpDevice *device, GpmEngine *engine)
+ #endif
+ {
+-#if !UP_CHECK_VERSION(0, 99, 0)
+ UpDeviceKind kind;
+-#endif
+ UpDeviceState state;
+ UpDeviceState state_old;
++#if UP_CHECK_VERSION(0, 99, 0)
++ UpDeviceLevel warning_old;
++ UpDeviceLevel warning;
++#else
+ GpmEngineWarning warning_old;
+ GpmEngineWarning warning;
++#endif
+
+-#if !UP_CHECK_VERSION(0, 99, 0)
+ /* get device properties */
+ g_object_get (device,
+ "kind", &kind,
+@@ -924,7 +982,6 @@
+ egg_debug ("updating because %s changed", up_device_get_object_path (device));
+ device = gpm_engine_update_composite_device (engine, device);
+ }
+-#endif
+
+ /* get device properties (may be composite) */
+ g_object_get (device,
+@@ -1109,22 +1166,10 @@
+ g_signal_connect (engine->priv->phone, "device-refresh",
+ G_CALLBACK (phone_device_refresh_cb), engine);
+
+-#if UP_CHECK_VERSION(0, 99, 0)
+- /* coldplug */
+- array = up_client_get_devices(engine->priv->client);
+- if (array) {
+- for (i = 0; i < array->len; i++) {
+- UpDevice *device = g_ptr_array_index (array, i);
+- gpm_engine_device_added_cb(engine->priv->client, device, engine);
+- }
+- g_ptr_array_free (array, TRUE);
+- }
+-#endif
+-
+ /* create a fake virtual composite battery */
+ #if UP_CHECK_VERSION(0, 99, 0)
+ engine->priv->battery_composite = up_client_get_display_device (engine->priv->client);
+- g_signal_connect (engine->priv->client, "notify",
++ g_signal_connect (engine->priv->battery_composite, "notify",
+ G_CALLBACK (gpm_engine_device_changed_cb), engine);
+ #else
+ engine->priv->battery_composite = up_device_new ();
+--- a/src/gpm-manager.c
++++ b/src/gpm-manager.c
+@@ -1963,7 +1963,9 @@
+ G_CALLBACK (gpm_manager_settings_changed_cb), manager);
+ manager->priv->client = up_client_new ();
+ #if UP_CHECK_VERSION(0, 99, 0)
+- g_signal_connect (manager->priv->client, "notify",
++ g_signal_connect (manager->priv->client, "notify::lid-is-closed",
++ G_CALLBACK (gpm_manager_client_changed_cb), manager);
++ g_signal_connect (manager->priv->client, "notify::on-battery",
+ G_CALLBACK (gpm_manager_client_changed_cb), manager);
+ #else
+ g_signal_connect (manager->priv->client, "changed",
diff --git a/debian/patches/series b/debian/patches/series
index 97f96ed..500a22a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,6 @@
+0001_upower-1.0_patch1.patch
+0001_upower-1.0_patch2.patch
+0001_upower-1.0_patch3.patch
1002_add-keywords-key-to-desktop-files.patch
2001_omit-gfdl-licensed-help-files.patch
2002_compile-extra-man-pages.patch
--
mate-power-manager Debian package
More information about the pkg-mate-commits
mailing list