diff options
author | Richard Hughes <richard@hughsie.com> | 2013-02-12 11:17:50 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2013-02-12 11:18:31 +0000 |
commit | 8bbf566dc8a80d129e202de619fe9da6f2e8b80b (patch) | |
tree | a98f365bd3d071be12788183798a0a883c6f3b15 | |
parent | 372c2f8d2922add987683a24b5d69902e05e2f97 (diff) |
Also deprecate running the powersave scripts
Over the years we've moved all the quirks to the kernel (and fixed most of the
issues properly) so on Fedora we've not actually been shipping any rules in
pm-utils for a couple of releaes now.
Dropping this functionality allows us to finally drop the pm-utils dep for upower.
-rw-r--r-- | src/linux/up-backend.c | 4 | ||||
-rw-r--r-- | src/up-backend.h | 2 | ||||
-rw-r--r-- | src/up-daemon.c | 12 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c index e77dd1b..60520a4 100644 --- a/src/linux/up-backend.c +++ b/src/linux/up-backend.c @@ -95,9 +95,9 @@ static void up_backend_device_remove (UpBackend *backend, GUdevDevice *native); #ifdef ENABLE_DEPRECATED #define UP_BACKEND_SUSPEND_COMMAND "/usr/sbin/pm-suspend" #define UP_BACKEND_HIBERNATE_COMMAND "/usr/sbin/pm-hibernate" -#endif #define UP_BACKEND_POWERSAVE_TRUE_COMMAND "/usr/sbin/pm-powersave true" #define UP_BACKEND_POWERSAVE_FALSE_COMMAND "/usr/sbin/pm-powersave false" +#endif /** * up_backend_device_new: @@ -628,6 +628,7 @@ up_backend_emits_resuming (UpBackend *backend) } #endif +#ifdef ENABLE_DEPRECATED /** * up_backend_get_powersave_command: **/ @@ -638,6 +639,7 @@ up_backend_get_powersave_command (UpBackend *backend, gboolean powersave) return UP_BACKEND_POWERSAVE_TRUE_COMMAND; return UP_BACKEND_POWERSAVE_FALSE_COMMAND; } +#endif /** * up_backend_class_init: diff --git a/src/up-backend.h b/src/up-backend.h index 2554453..c380a74 100644 --- a/src/up-backend.h +++ b/src/up-backend.h @@ -78,8 +78,10 @@ gfloat up_backend_get_used_swap (UpBackend *backend); const gchar *up_backend_get_suspend_command (UpBackend *backend); const gchar *up_backend_get_hibernate_command (UpBackend *backend); #endif +#ifdef ENABLE_DEPRECATED const gchar *up_backend_get_powersave_command (UpBackend *backend, gboolean powersave); +#endif #ifdef ENABLE_DEPRECATED gboolean up_backend_emits_resuming (UpBackend *backend); #endif diff --git a/src/up-daemon.c b/src/up-daemon.c index a5ab658..05b029c 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -102,8 +102,8 @@ struct UpDaemonPrivate guint about_to_sleep_id; guint conf_sleep_timeout; gboolean conf_allow_hibernate_encrypted_swap; -#endif gboolean conf_run_powersave_command; +#endif const gchar *sleep_kind; }; @@ -254,6 +254,7 @@ up_daemon_get_on_ac_local (UpDaemon *daemon) return result; } +#ifdef ENABLE_DEPRECATED /** * up_daemon_set_powersave: **/ @@ -280,6 +281,7 @@ up_daemon_set_powersave (UpDaemon *daemon, gboolean powersave) out: return ret; } +#endif /** * up_daemon_refresh_battery_devices: @@ -847,9 +849,11 @@ up_daemon_startup (UpDaemon *daemon) priv->during_coldplug = FALSE; g_debug ("daemon now not coldplug"); +#ifdef ENABLE_DEPRECATED /* set power policy */ if (priv->conf_run_powersave_command) up_daemon_set_powersave (daemon, priv->on_battery); +#endif out: return ret; } @@ -1020,9 +1024,11 @@ up_daemon_device_changed_cb (UpDevice *device, UpDaemon *daemon) if (ret != priv->on_battery) { up_daemon_set_on_battery (daemon, ret); +#ifdef ENABLE_DEPRECATED /* set power policy */ if (priv->conf_run_powersave_command) up_daemon_set_powersave (daemon, ret); +#endif } ret = up_daemon_get_on_low_battery_local (daemon); if (ret != priv->on_low_battery) @@ -1166,8 +1172,8 @@ up_daemon_init (UpDaemon *daemon) daemon->priv->battery_poll_count = 0; #ifdef ENABLE_DEPRECATED daemon->priv->conf_sleep_timeout = 1000; -#endif daemon->priv->conf_run_powersave_command = TRUE; +#endif /* load some values from the config file */ file = g_key_file_new (); @@ -1185,9 +1191,9 @@ up_daemon_init (UpDaemon *daemon) g_key_file_get_integer (file, "UPower", "SleepTimeout", NULL); daemon->priv->conf_allow_hibernate_encrypted_swap = g_key_file_get_boolean (file, "UPower", "AllowHibernateEncryptedSwap", NULL); -#endif daemon->priv->conf_run_powersave_command = g_key_file_get_boolean (file, "UPower", "RunPowersaveCommand", NULL); +#endif } else { g_warning ("failed to load config file %s: %s", filename, error->message); g_error_free (error); |