aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-27 15:22:08 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-28 16:02:38 -0500
commit7353fc1cb85e08eb6e884ed8bbf9a009226069b6 (patch)
tree4006c2a4e32d6cf01950de6ab27b650872121c5e
parentelm_theme: massively simplify internals (diff)
downloadefl-7353fc1cb85e08eb6e884ed8bbf9a009226069b6.tar.gz
elm_theme: deduplicate theme apply code
the "default" style fallback code here was identical, so just call again with "default" instead of copy and pasting the same code
-rw-r--r--src/lib/elementary/elm_theme.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index f47c3217d9..f060064494 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -321,35 +321,9 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
if (!style)
return EFL_UI_THEME_APPLY_FAILED;
+ if (eina_streq(style, "default")) return EFL_UI_THEME_APPLY_FAILED;
// Use the elementary default style.
- if (is_legacy)
- snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, (group) ? group : "base", "default");
- else
- snprintf(buf2, sizeof(buf2), "efl/%s%s%s", clas,
- ((group) ? group_sep : "\0"), ((group) ? group : "\0"));
- if (!eina_hash_find(th->cache_style_load_failed, buf2))
- {
- file = _elm_theme_group_file_find(th, buf2);
- if (file)
- {
- if (edje_object_mmap_set(o, file, buf2))
- {
- INF("could not set theme style '%s', fallback to default",
- style);
- return EFL_UI_THEME_APPLY_DEFAULT;
- }
- else
- {
- INF("could not set theme group '%s' from file '%s': %s",
- buf2,
- eina_file_filename_get(file),
- edje_load_error_str(edje_object_load_error_get(o)));
- }
- }
- //style not found, add to the not found list
- eina_hash_add(th->cache_style_load_failed, buf2, (void *)1);
- }
- return EFL_UI_THEME_APPLY_FAILED;
+ return _elm_theme_set(th, o, clas, group, "default", is_legacy);
}
Eina_Bool