mixer: simplify icon logic.
This commit is contained in:
parent
b59c07ea33
commit
5133b018a5
|
@ -84,7 +84,6 @@ _sink_icon_find(const char *name)
|
|||
const char *dir;
|
||||
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
||||
FILE *f;
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
dir = e_module_dir_get(mixer_context->module);
|
||||
|
@ -102,19 +101,12 @@ _sink_icon_find(const char *name)
|
|||
strs = eina_str_split(buf, "|", 0);
|
||||
if (strs)
|
||||
{
|
||||
i = 0;
|
||||
for (glob = strs[i]; glob; i += 2)
|
||||
glob = strs[0];
|
||||
icon = strs[1];
|
||||
if (icon)
|
||||
{
|
||||
icon = strs[i + 1];
|
||||
if (icon)
|
||||
{
|
||||
if (e_util_glob_case_match(name, glob))
|
||||
{
|
||||
res = strdup(icon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else break;
|
||||
if (e_util_glob_case_match(name, glob))
|
||||
res = strdup(icon);
|
||||
}
|
||||
free(strs[0]);
|
||||
free(strs);
|
||||
|
|
|
@ -52,11 +52,8 @@ _sink_icon_find(const char *name)
|
|||
const char *file;
|
||||
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
||||
FILE *f;
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
if (!name) return NULL;
|
||||
|
||||
file = getenv("EMIX_SINK_ICONS");
|
||||
if (!file) return NULL;
|
||||
f = fopen(file, "r");
|
||||
|
@ -71,23 +68,18 @@ _sink_icon_find(const char *name)
|
|||
strs = eina_str_split(buf, "|", 0);
|
||||
if (strs)
|
||||
{
|
||||
i = 0;
|
||||
for (glob = strs[i]; glob; i += 2)
|
||||
glob = strs[0];
|
||||
icon = strs[1];
|
||||
if (icon)
|
||||
{
|
||||
icon = strs[i + 1];
|
||||
if (icon)
|
||||
if (_glob_case_match(name, glob))
|
||||
{
|
||||
if (_glob_case_match(name, glob))
|
||||
{
|
||||
res = strdup(icon);
|
||||
break;
|
||||
}
|
||||
res = strdup(icon);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
free(strs[0]);
|
||||
free(strs);
|
||||
}
|
||||
free(strs[0]);
|
||||
free(strs);
|
||||
if (res) break;
|
||||
}
|
||||
else break;
|
||||
|
|
Loading…
Reference in New Issue