remove acpi debugging and label lid state properly in the ui!

SVN revision: 68223
This commit is contained in:
Carsten Haitzler 2012-02-21 14:35:00 +00:00
parent 0377e75f9a
commit 0add92b38a
2 changed files with 3 additions and 7 deletions

View File

@ -208,7 +208,6 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
strncpy(sdata, str, (int)(p - str));
sdata[p - str] = 0;
/* parse out this acpi string into separate pieces */
printf("DBG ACPI: ACPI Event string: '%s'\n", sdata);
if (sscanf(sdata, "%1023s %1023s %x %x",
device, bus, &sig, &status) == 4)
{
@ -321,8 +320,6 @@ _e_acpi_lid_status_get(const char *device, const char *bus)
snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s/state", device, bus);
if (!(f = fopen(buff, "r"))) return E_ACPI_LID_UNKNOWN;
printf("DBG ACPI: Lid state string: '%s'\n", buff);
/* read the line from state file */
buff[0] = '\0';
ret = fgets(buff, 1024, f);
@ -336,8 +333,6 @@ _e_acpi_lid_status_get(const char *device, const char *bus)
while (isalnum(buff[i])) i++;
buff[i] = 0;
printf("DBG ACPI: Lid string '%s'\n", ret);
/* compare value from state file and return something sane */
if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN;
else if (!strcmp(ret, "closed")) return E_ACPI_LID_CLOSED;

View File

@ -358,8 +358,9 @@ _binding_label_get(E_Config_Binding_Acpi *bind)
return _("Fan");
if (bind->type == E_ACPI_TYPE_LID)
{
if (bind->status == 0) return _("Lid Closed");
if (bind->status == 1) return _("Lid Opened");
if (bind->status == E_ACPI_LID_UNKNOWN) return _("Lid Unknown");
if (bind->status == E_ACPI_LID_CLOSED) return _("Lid Closed");
if (bind->status == E_ACPI_LID_OPEN) return _("Lid Opened");
return _("Lid");
}
if (bind->type == E_ACPI_TYPE_POWER)