From 060a4507145425c02c6aa0ef810138c04d38f5a9 Mon Sep 17 00:00:00 2001 From: Brent Hull Date: Tue, 30 Oct 2012 15:55:35 -0400 Subject: Use gsettings enums (partially from GNOME) --- src/gpm-common.c | 84 -------------------------------------------------------- 1 file changed, 84 deletions(-) (limited to 'src/gpm-common.c') diff --git a/src/gpm-common.c b/src/gpm-common.c index 0d0e536..861837a 100644 --- a/src/gpm-common.c +++ b/src/gpm-common.c @@ -78,90 +78,6 @@ gpm_get_timestring (guint time_secs) return timestring; } -/** - * gpm_icon_policy_from_string: - **/ -GpmIconPolicy -gpm_icon_policy_from_string (const gchar *policy) -{ - if (policy == NULL) - return GPM_ICON_POLICY_NEVER; - if (g_strcmp0 (policy, "always") == 0) - return GPM_ICON_POLICY_ALWAYS; - if (g_strcmp0 (policy, "present") == 0) - return GPM_ICON_POLICY_PRESENT; - if (g_strcmp0 (policy, "charge") == 0) - return GPM_ICON_POLICY_CHARGE; - if (g_strcmp0 (policy, "low") == 0) - return GPM_ICON_POLICY_LOW; - if (g_strcmp0 (policy, "critical") == 0) - return GPM_ICON_POLICY_CRITICAL; - if (g_strcmp0 (policy, "never") == 0) - return GPM_ICON_POLICY_NEVER; - return GPM_ICON_POLICY_NEVER; -} - -/** - * gpm_icon_policy_to_string: - **/ -const gchar * -gpm_icon_policy_to_string (GpmIconPolicy policy) -{ - if (policy == GPM_ICON_POLICY_ALWAYS) - return "always"; - if (policy == GPM_ICON_POLICY_PRESENT) - return "present"; - if (policy == GPM_ICON_POLICY_CHARGE) - return "charge"; - if (policy == GPM_ICON_POLICY_LOW) - return "low"; - if (policy == GPM_ICON_POLICY_CRITICAL) - return "critical"; - if (policy == GPM_ICON_POLICY_NEVER) - return "never"; - return "never"; -} - -/** - * gpm_action_policy_from_string: - **/ -GpmActionPolicy -gpm_action_policy_from_string (const gchar *policy) -{ - if (policy == NULL) - return GPM_ACTION_POLICY_NOTHING; - if (g_strcmp0 (policy, "blank") == 0) - return GPM_ACTION_POLICY_BLANK; - if (g_strcmp0 (policy, "shutdown") == 0) - return GPM_ACTION_POLICY_SHUTDOWN; - if (g_strcmp0 (policy, "suspend") == 0) - return GPM_ACTION_POLICY_SUSPEND; - if (g_strcmp0 (policy, "hibernate") == 0) - return GPM_ACTION_POLICY_HIBERNATE; - if (g_strcmp0 (policy, "interactive") == 0) - return GPM_ACTION_POLICY_INTERACTIVE; - return GPM_ACTION_POLICY_NOTHING; -} - -/** - * gpm_action_policy_to_string: - **/ -const gchar * -gpm_action_policy_to_string (GpmActionPolicy policy) -{ - if (policy == GPM_ACTION_POLICY_BLANK) - return "blank"; - if (policy == GPM_ACTION_POLICY_SHUTDOWN) - return "shutdown"; - if (policy == GPM_ACTION_POLICY_SUSPEND) - return "suspend"; - if (policy == GPM_ACTION_POLICY_HIBERNATE) - return "hibernate"; - if (policy == GPM_ACTION_POLICY_INTERACTIVE) - return "interactive"; - return "nothing"; -} - /** * gpm_help_display: * @link_id: Subsection of mate-power-manager help section -- cgit v1.2.1