From 0e31d51ba6d42604487efc06d60b1f176e21e323 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 23 Dec 2010 00:51:49 +0000 Subject: [PATCH] clean up _binding_label_get to just return the correct value, fix potential garbage return SVN revision: 55730 --- .../e_int_config_acpibindings.c | 58 +++++++++---------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/src/modules/conf_acpibindings/e_int_config_acpibindings.c b/src/modules/conf_acpibindings/e_int_config_acpibindings.c index 907cc139b..dc98a89d3 100644 --- a/src/modules/conf_acpibindings/e_int_config_acpibindings.c +++ b/src/modules/conf_acpibindings/e_int_config_acpibindings.c @@ -341,43 +341,39 @@ _selected_action_get(E_Config_Dialog_Data *cfdata) static const char * _binding_label_get(E_Config_Binding_Acpi *bind) { - char *ret; - if (bind->type == E_ACPI_TYPE_UNKNOWN) return NULL; - else if (bind->type == E_ACPI_TYPE_AC_ADAPTER) + if (bind->type == E_ACPI_TYPE_AC_ADAPTER) { - ret = _("Ac Adapter"); - if (bind->status == 0) ret = _("AC Adapter Unplugged"); - else if (bind->status == 1) - ret = _("AC Adapter Plugged"); + if (bind->status == 0) return _("AC Adapter Unplugged"); + if (bind->status == 1) return _("AC Adapter Plugged"); + return _("Ac Adapter"); } - else if (bind->type == E_ACPI_TYPE_BATTERY) - ret = _("Battery"); - else if (bind->type == E_ACPI_TYPE_BUTTON) - ret = _("Button"); - else if (bind->type == E_ACPI_TYPE_FAN) - ret = _("Fan"); - else if (bind->type == E_ACPI_TYPE_LID) + if (bind->type == E_ACPI_TYPE_BATTERY) + return _("Battery"); + if (bind->type == E_ACPI_TYPE_BUTTON) + return _("Button"); + if (bind->type == E_ACPI_TYPE_FAN) + return _("Fan"); + if (bind->type == E_ACPI_TYPE_LID) { - ret = _("Lid"); - if (bind->status == 0) ret = _("Lid Closed"); - else if (bind->status == 1) - ret = _("Lid Opened"); + if (bind->status == 0) return _("Lid Closed"); + if (bind->status == 1) return _("Lid Opened"); + return _("Lid"); } - else if (bind->type == E_ACPI_TYPE_POWER) - ret = _("Power Button"); - else if (bind->type == E_ACPI_TYPE_PROCESSOR) - ret = _("Processor"); - else if (bind->type == E_ACPI_TYPE_SLEEP) - ret = _("Sleep Button"); - else if (bind->type == E_ACPI_TYPE_THERMAL) - ret = _("Thermal"); - else if (bind->type == E_ACPI_TYPE_VIDEO) - ret = _("Video"); - else if (bind->type == E_ACPI_TYPE_WIFI) - ret = _("Wifi"); + if (bind->type == E_ACPI_TYPE_POWER) + return _("Power Button"); + if (bind->type == E_ACPI_TYPE_PROCESSOR) + return _("Processor"); + if (bind->type == E_ACPI_TYPE_SLEEP) + return _("Sleep Button"); + if (bind->type == E_ACPI_TYPE_THERMAL) + return _("Thermal"); + if (bind->type == E_ACPI_TYPE_VIDEO) + return _("Video"); + if (bind->type == E_ACPI_TYPE_WIFI) + return _("Wifi"); - return ret; + return NULL; } static void