[gnome-settings-daemon/gnome-3-8] media-keys: Merge power_action_* functions
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-8] media-keys: Merge power_action_* functions
- Date: Thu, 7 Nov 2013 16:19:11 +0000 (UTC)
commit 6ffc07f87a09deeaa4bbd6156fc1dbd733d4ab27
Author: Bastien Nocera <hadess hadess net>
Date: Sat Oct 19 23:58:34 2013 +0200
media-keys: Merge power_action_* functions
They only differed by a single line.
plugins/media-keys/gsd-media-keys-manager.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 93cf14e..2c46d74 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1766,22 +1766,11 @@ do_toggle_contrast_action (GsdMediaKeysManager *manager)
}
static void
-power_action_suspend (GsdMediaKeysManager *manager)
+power_action (GsdMediaKeysManager *manager,
+ const char *action)
{
g_dbus_proxy_call (manager->priv->logind_proxy,
- "Suspend",
- g_variant_new ("(b)", TRUE),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- manager->priv->bus_cancellable,
- NULL, NULL);
-}
-
-static void
-power_action_hibernate (GsdMediaKeysManager *manager)
-{
- g_dbus_proxy_call (manager->priv->logind_proxy,
- "Hibernate",
+ action,
g_variant_new ("(b)", TRUE),
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
@@ -1799,14 +1788,14 @@ do_config_power_action (GsdMediaKeysManager *manager,
config_key);
switch (action_type) {
case GSD_POWER_ACTION_SUSPEND:
- power_action_suspend (manager);
+ power_action (manager, "Suspend");
break;
case GSD_POWER_ACTION_INTERACTIVE:
case GSD_POWER_ACTION_SHUTDOWN:
gnome_session_shutdown (manager);
break;
case GSD_POWER_ACTION_HIBERNATE:
- power_action_hibernate (manager);
+ power_action (manager, "Hibernate");
break;
case GSD_POWER_ACTION_BLANK:
case GSD_POWER_ACTION_NOTHING:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]