[gnome-power-manager] Fix compile with DKP_DISABLE_DEPRECATED turned on
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-power-manager] Fix compile with DKP_DISABLE_DEPRECATED turned on
- Date: Fri, 3 Jul 2009 12:53:59 +0000 (UTC)
commit 4894a3d66ed65615e2effec166cc6988dd52202b
Author: Richard Hughes <richard hughsie com>
Date: Fri Jul 3 11:14:20 2009 +0100
Fix compile with DKP_DISABLE_DEPRECATED turned on
src/Makefile.am | 1 +
src/gpm-backlight.c | 15 +++++++++++----
src/gpm-button.c | 4 +++-
src/gpm-control.c | 13 +++++++++++--
src/gpm-manager.c | 8 ++++++--
src/gpm-notify.c | 4 +++-
src/gpm-prefs-core.c | 8 ++++++--
7 files changed, 41 insertions(+), 12 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 1632946..32389fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,7 @@ INCLUDES = \
-DLIBDIR=\""$(libdir)"\" \
-DVERSION="\"$(VERSION)\"" \
-DGPM_DATA=\"$(pkgdatadir)\" \
+ -DDKP_DISABLE_DEPRECATED \
-DEGG_LOG_FILE=\""/tmp/gpm.log"\" \
-DEGG_VERBOSE="\"GPM_VERBOSE\"" \
-DEGG_LOGGING="\"GPM_LOGGING\"" \
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c
index d85889e..587a308 100644
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -215,8 +215,10 @@ gpm_backlight_brightness_evaluate_and_set (GpmBacklight *backlight, gboolean int
brightness = backlight->priv->master_percentage / 100.0f;
egg_debug ("1. main brightness %f", brightness);
- /* get AC status */
- on_battery = dkp_client_on_battery (backlight->priv->client);
+ /* get battery status */
+ g_object_get (backlight->priv->client,
+ "on-battery", &on_battery,
+ NULL);
/* reduce if on battery power if we should */
battery_reduce = gconf_client_get_bool (backlight->priv->conf, GPM_CONF_BACKLIGHT_BATTERY_REDUCE, NULL);
@@ -309,7 +311,10 @@ gpm_conf_gconf_key_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *e
if (value == NULL)
return;
- on_battery = dkp_client_on_battery (backlight->priv->client);
+ /* get battery status */
+ g_object_get (backlight->priv->client,
+ "on-battery", &on_battery,
+ NULL);
if (!on_battery && strcmp (entry->key, GPM_CONF_BACKLIGHT_BRIGHTNESS_AC) == 0) {
backlight->priv->master_percentage = gconf_value_get_int (value);
@@ -515,7 +520,9 @@ idle_changed_cb (GpmIdle *idle, GpmIdleMode mode, GpmBacklight *backlight)
gpm_backlight_brightness_evaluate_and_set (backlight, FALSE);
/* get the DPMS state we're supposed to use on the power state */
- on_battery = dkp_client_on_battery (backlight->priv->client);
+ g_object_get (backlight->priv->client,
+ "on-battery", &on_battery,
+ NULL);
if (!on_battery)
dpms_method = gconf_client_get_string (backlight->priv->conf, GPM_CONF_BACKLIGHT_DPMS_METHOD_AC, NULL);
else
diff --git a/src/gpm-button.c b/src/gpm-button.c
index b9cb8df..ec3fef5 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -526,7 +526,9 @@ gpm_button_client_changed_cb (DkpClient *client, GpmButton *button)
gboolean lid_is_closed;
/* get new state */
- lid_is_closed = dkp_client_lid_is_closed (client);
+ g_object_get (client,
+ "lid-is-closed", &lid_is_closed,
+ NULL);
/* same state */
if (button->priv->lid_is_closed == lid_is_closed)
diff --git a/src/gpm-control.c b/src/gpm-control.c
index 043b667..37128d4 100644
--- a/src/gpm-control.c
+++ b/src/gpm-control.c
@@ -164,9 +164,14 @@ gpm_control_allowed_suspend (GpmControl *control, gboolean *can, GError **error)
g_return_val_if_fail (can, FALSE);
*can = FALSE;
+
+ /* get values from DkpClient */
+ g_object_get (control->priv->client,
+ "can-suspend", &hardware_ok,
+ NULL);
+
conf_ok = gconf_client_get_bool (control->priv->conf, GPM_CONF_CAN_SUSPEND, NULL);
polkit_ok = gpm_control_is_user_privileged (control, "org.freedesktop.devicekit.power.suspend");
- hardware_ok = dkp_client_can_suspend (control->priv->client);
fg = gpm_control_check_foreground_console (control);
if (conf_ok && hardware_ok && polkit_ok && fg)
*can = TRUE;
@@ -191,11 +196,15 @@ gpm_control_allowed_hibernate (GpmControl *control, gboolean *can, GError **erro
gboolean fg;
g_return_val_if_fail (can, FALSE);
+ /* get values from DkpClient */
+ g_object_get (control->priv->client,
+ "can-hibernate", &hardware_ok,
+ NULL);
+
*can = FALSE;
conf_ok = gconf_client_get_bool (control->priv->conf, GPM_CONF_CAN_HIBERNATE, NULL);
fg = gpm_control_check_foreground_console (control);
polkit_ok = gpm_control_is_user_privileged (control, "org.freedesktop.devicekit.power.hibernate");
- hardware_ok = dkp_client_can_hibernate (control->priv->client);
if (conf_ok && hardware_ok && polkit_ok && fg)
*can = TRUE;
egg_debug ("conf=%i, polkit=%i, fg=%i, can=%i", conf_ok, polkit_ok, fg, *can);
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 7b5375a..4f406ca 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -818,7 +818,9 @@ gpm_manager_client_changed_cb (DkpClient *client, GpmManager *manager)
gboolean on_battery;
/* get the on-battery state */
- on_battery = dkp_client_on_battery (manager->priv->client);
+ g_object_get (client,
+ "on-battery", &on_battery,
+ NULL);
if (on_battery == manager->priv->on_battery) {
egg_debug ("same state as before, ignoring");
return;
@@ -1543,7 +1545,9 @@ gpm_manager_init (GpmManager *manager)
}
/* coldplug so we are in the correct state at startup */
- manager->priv->on_battery = dkp_client_on_battery (manager->priv->client);
+ g_object_get (manager->priv->client,
+ "on-battery", &manager->priv->on_battery,
+ NULL);
manager->priv->button = gpm_button_new ();
g_signal_connect (manager->priv->button, "button-pressed",
diff --git a/src/gpm-notify.c b/src/gpm-notify.c
index a6e22a0..3b0fd25 100644
--- a/src/gpm-notify.c
+++ b/src/gpm-notify.c
@@ -192,7 +192,9 @@ gpm_notify_client_changed_cb (DkpClient *client, GpmNotify *notify)
/* for where we add back the client before the "AC Power unplugged"
* message times out. */
- on_battery = dkp_client_on_battery (client);
+ g_object_get (client,
+ "on-battery", &on_battery,
+ NULL);
if (!on_battery) {
egg_debug ("clearing notify due ac being present");
gpm_notify_cancel (notify);
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 5332173..1093df7 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -1009,10 +1009,14 @@ gpm_prefs_init (GpmPrefs *prefs)
prefs->priv->has_button_lid = ((caps & GPM_PREFS_SERVER_LID) > 0);
prefs->priv->has_button_suspend = TRUE;
prefs->priv->can_shutdown = TRUE;
- prefs->priv->can_suspend = dkp_client_can_suspend (prefs->priv->client);
- prefs->priv->can_hibernate = dkp_client_can_hibernate (prefs->priv->client);
egg_debug ("caps=%i", caps);
+ /* get values from DkpClient */
+ g_object_get (prefs->priv->client,
+ "can-suspend", &prefs->priv->can_suspend,
+ "can-hibernate", &prefs->priv->can_hibernate,
+ NULL);
+
prefs->priv->builder = gtk_builder_new ();
retval = gtk_builder_add_from_file (prefs->priv->builder, GPM_DATA "/gpm-prefs.ui", &error);
if (error != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]