diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-03-26 18:06:08 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-03-26 18:06:08 +0900 |
commit | bc860d5cb14ef792251324de54041efcb75538cd (patch) | |
tree | 2cb7ddbf0efd7894142b61994e63b06269936d01 | |
parent | f8ced14ed63c4144a185c697fe1004fbabd9a35e (diff) | |
download | elementary-bc860d5cb14ef792251324de54041efcb75538cd.tar.gz |
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.
-rw-r--r-- | data/themes/default.edc | 4 | ||||
-rw-r--r-- | src/lib/elm_theme.c | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/data/themes/default.edc b/data/themes/default.edc index 28544db8f..157d52fb6 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 d6f47f020..9ba16f5fe 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, |