From bc860d5cb14ef792251324de54041efcb75538cd Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 26 Mar 2014 18:06:08 +0900 Subject: [PATCH] general "bugfix" via feature - add version numbering for elm theme this now has elm themes have a version number. we start at 110 (just matches efl/elm 1.10 that this will be released in) and this means theme files that do not claim a recent enough version (or claim no version at all) will not load/be used. default should/would always provide this so you always will fall back. --- data/themes/default.edc | 4 ++++ src/lib/elm_theme.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 28544db..157d52f 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -2,6 +2,10 @@ externals.external: "elm"; +// theme api version. from 1.10 on we will check version to avoid +// compat issues +data.item: "version" "110"; + collections { #include "fonts.edc" #include "colorclasses.edc" diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c index d6f47f0..9ba16f5 100644 --- a/src/lib/elm_theme.c +++ b/src/lib/elm_theme.c @@ -31,8 +31,16 @@ _elm_theme_item_finalize(Elm_Theme_Files *files, Eina_File *f, Eina_Bool prepend) { + char *version; + if (!f) return; - + if (!(version = edje_mmap_data_get(f, "version"))) return; + if (atoi(version) < 110) // bump this version number when we need to + { + free(version); + return; + } + free(version); if (prepend) { files->items = eina_list_prepend(files->items, -- 2.7.4