aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/vkbd/e_kbd_int.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-08 10:23:54 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-08 10:46:25 -0500
commitd86b2447996802810f1f8442b43e98ef5cbf0d85 (patch)
tree2b8c60eb7e3490eb85430d68be8e9856a63ccbc2 /src/modules/vkbd/e_kbd_int.c
parentadd sandbox gadget event to indicate gadget configure (diff)
downloadenlightenment-d86b2447996802810f1f8442b43e98ef5cbf0d85.tar.gz
simplify icon suffix detection in vkbd module
CID 1132746, 1132747
Diffstat (limited to 'src/modules/vkbd/e_kbd_int.c')
-rw-r--r--src/modules/vkbd/e_kbd_int.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/modules/vkbd/e_kbd_int.c b/src/modules/vkbd/e_kbd_int.c
index 5fbe6856e..277470494 100644
--- a/src/modules/vkbd/e_kbd_int.c
+++ b/src/modules/vkbd/e_kbd_int.c
@@ -175,12 +175,10 @@ _e_kbd_int_layout_state_update(E_Kbd_Int *ki)
if (st->icon)
{
char buf[PATH_MAX];
- char *p;
snprintf(buf, sizeof(buf), "%s/%s",
ki->layout.directory, st->icon);
- p = strrchr(st->icon, '.');
- if (!strcmp(p, ".edj"))
+ if (eina_str_has_extension(st->icon, ".edj"))
e_icon_file_edje_set(ky->icon_obj, buf, "icon");
else
e_icon_file_set(ky->icon_obj, buf);
@@ -975,7 +973,6 @@ _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
if ((!strcmp(str, "normal")) || (!strcmp(str, "shift")) ||
(!strcmp(str, "capslock")) || (!strcmp(str, "altgr")))
{
- char *p;
char label[4096];
if (sscanf(buf, "%*s %4000s", label) != 1) continue;
@@ -986,10 +983,7 @@ _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
if (!strcmp(str, "shift")) st->state = SHIFT;
if (!strcmp(str, "capslock")) st->state = CAPSLOCK;
if (!strcmp(str, "altgr")) st->state = ALTGR;
- p = strrchr(label, '.');
- if ((p) && (!strcmp(p, ".png")))
- st->icon = eina_stringshare_add(label);
- else if ((p) && (!strcmp(p, ".edj")))
+ if (eina_str_has_extension(label, ".png") || eina_str_has_extension(label, ".edj"))
st->icon = eina_stringshare_add(label);
else
st->label = eina_stringshare_add(label);