summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_layout.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-25 07:30:24 -0400
committerCedric Bail <cedric.bail@free.fr>2019-09-25 11:30:57 -0700
commit9206960dfac9e2ad6651c69e24a3df5c1b92a2eb (patch)
tree7cde9d6f0b29d9e8c400821e3e62d33a3b3f5cbc /src/lib/elementary/efl_ui_layout.c
parent71cd89c5809e957b42ff76642f34bb5789ad6a78 (diff)
downloadefl-9206960dfac9e2ad6651c69e24a3df5c1b92a2eb.tar.gz
efl_ui/layout: add explicit error case when theme version > efl version
it's important to handle cases where a "future" theme is trying to be used by "current" efl. this throws a serious error, since it's possible that the widget may look/act in a way that makes it unusable ref T8231 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10153
Diffstat (limited to 'src/lib/elementary/efl_ui_layout.c')
-rw-r--r--src/lib/elementary/efl_ui_layout.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index ec5e731dfd..c4310f01c1 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -545,8 +545,11 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
{
const char *version = edje_object_data_get(wd->resize_obj, "version");
if (!version)
- ERR("Widget(%p) with type '%s' is not providing a version in its theme!", obj,
- efl_class_name_get(efl_class_get(obj)));
+ {
+ ERR("Widget(%p) with type '%s' is not providing a version in its theme!", obj,
+ efl_class_name_get(efl_class_get(obj)));
+ return EFL_UI_THEME_APPLY_ERROR_VERSION;
+ }
else
{
errno = 0;
@@ -556,6 +559,7 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
ERR("Widget(%p) with type '%s' is not providing a valid version in its theme!", obj,
efl_class_name_get(efl_class_get(obj)));
sd->version = 0;
+ return EFL_UI_THEME_APPLY_ERROR_VERSION;
}
}
}
@@ -575,6 +579,13 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
if (sd->version < version)
WRN("Widget(%p) with type '%s' is providing a potentially old version in its theme: found %u, should be %u", obj,
efl_class_name_get(efl_class_get(obj)), sd->version, version);
+ else if (sd->version > version)
+ {
+ CRI("Widget(%p) with type '%s' is attempting to use a theme that is too new: found %u, should be %u", obj,
+ efl_class_name_get(efl_class_get(obj)), sd->version, version);
+ CRI("\tTheme file: %s\tTheme group: %s", efl_file_get(obj), efl_file_key_get(obj));
+ return EFL_UI_THEME_APPLY_ERROR_VERSION;
+ }
}
return EFL_UI_THEME_APPLY_ERROR_NONE;