forked from enlightenment/enlightenment
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;
|
const char *dir;
|
||||||
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int i;
|
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
dir = e_module_dir_get(mixer_context->module);
|
dir = e_module_dir_get(mixer_context->module);
|
||||||
|
@ -102,19 +101,12 @@ _sink_icon_find(const char *name)
|
||||||
strs = eina_str_split(buf, "|", 0);
|
strs = eina_str_split(buf, "|", 0);
|
||||||
if (strs)
|
if (strs)
|
||||||
{
|
{
|
||||||
i = 0;
|
glob = strs[0];
|
||||||
for (glob = strs[i]; glob; i += 2)
|
icon = strs[1];
|
||||||
|
if (icon)
|
||||||
{
|
{
|
||||||
icon = strs[i + 1];
|
if (e_util_glob_case_match(name, glob))
|
||||||
if (icon)
|
res = strdup(icon);
|
||||||
{
|
|
||||||
if (e_util_glob_case_match(name, glob))
|
|
||||||
{
|
|
||||||
res = strdup(icon);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
}
|
}
|
||||||
free(strs[0]);
|
free(strs[0]);
|
||||||
free(strs);
|
free(strs);
|
||||||
|
|
|
@ -52,11 +52,8 @@ _sink_icon_find(const char *name)
|
||||||
const char *file;
|
const char *file;
|
||||||
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
char buf[PATH_MAX], *res = NULL, **strs, *glob, *icon;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int i;
|
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (!name) return NULL;
|
|
||||||
|
|
||||||
file = getenv("EMIX_SINK_ICONS");
|
file = getenv("EMIX_SINK_ICONS");
|
||||||
if (!file) return NULL;
|
if (!file) return NULL;
|
||||||
f = fopen(file, "r");
|
f = fopen(file, "r");
|
||||||
|
@ -71,23 +68,18 @@ _sink_icon_find(const char *name)
|
||||||
strs = eina_str_split(buf, "|", 0);
|
strs = eina_str_split(buf, "|", 0);
|
||||||
if (strs)
|
if (strs)
|
||||||
{
|
{
|
||||||
i = 0;
|
glob = strs[0];
|
||||||
for (glob = strs[i]; glob; i += 2)
|
icon = strs[1];
|
||||||
|
if (icon)
|
||||||
{
|
{
|
||||||
icon = strs[i + 1];
|
if (_glob_case_match(name, glob))
|
||||||
if (icon)
|
|
||||||
{
|
{
|
||||||
if (_glob_case_match(name, glob))
|
res = strdup(icon);
|
||||||
{
|
|
||||||
res = strdup(icon);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else break;
|
|
||||||
}
|
}
|
||||||
free(strs[0]);
|
|
||||||
free(strs);
|
|
||||||
}
|
}
|
||||||
|
free(strs[0]);
|
||||||
|
free(strs);
|
||||||
if (res) break;
|
if (res) break;
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
|
|
Loading…
Reference in New Issue