backlight: Only check output name if sysdev is set

We only have an action inside the for loop if sysdev is set, so move the
check outside the for loop.
This commit is contained in:
Sebastian Dransfeld 2014-04-23 12:13:40 +02:00
parent 04a8f58ff9
commit 25741f93fa
1 changed files with 10 additions and 8 deletions

View File

@ -277,18 +277,20 @@ _e_backlight_set(E_Zone *zone, double val)
if ((out) && (num > 0))
{
Eina_Bool gotten = EINA_FALSE;
for (i = 0; i < num; i++)
if (e_config->backlight.sysdev)
{
name = ecore_x_randr_output_name_get(root, out[i], NULL);
if (name)
for (i = 0; i < num; i++)
{
if ((e_config->backlight.sysdev) &&
(!strcmp(name, e_config->backlight.sysdev)))
name = ecore_x_randr_output_name_get(root, out[i], NULL);
if (name)
{
ecore_x_randr_output_backlight_level_set(root, out[i], val);
gotten = EINA_TRUE;
if (!strcmp(name, e_config->backlight.sysdev))
{
ecore_x_randr_output_backlight_level_set(root, out[i], val);
gotten = EINA_TRUE;
}
free(name);
}
free(name);
}
}
if (!gotten)