summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 16:17:38 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 16:17:38 +0900
commitfda28bfcfd1ab4b56f75173a926256934eed3942 (patch)
tree77509f9b20b9497ab2e960888b1a918c10e5dc8d
parent6b0619a88ae0a5efcc73164660b2ab479446aceb (diff)
fix my theme version fix to not version extns/overlays
-rw-r--r--src/lib/elm_theme.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c
index 9ba16f5fe..bf77c3f8a 100644
--- a/src/lib/elm_theme.c
+++ b/src/lib/elm_theme.c
@@ -29,18 +29,22 @@ static inline void
29_elm_theme_item_finalize(Elm_Theme_Files *files, 29_elm_theme_item_finalize(Elm_Theme_Files *files,
30 const char *item, 30 const char *item,
31 Eina_File *f, 31 Eina_File *f,
32 Eina_Bool prepend) 32 Eina_Bool prepend,
33 Eina_Bool istheme)
33{ 34{
34 char *version;
35
36 if (!f) return; 35 if (!f) return;
37 if (!(version = edje_mmap_data_get(f, "version"))) return; 36 if (istheme)
38 if (atoi(version) < 110) // bump this version number when we need to
39 { 37 {
38 char *version;
39
40 if (!(version = edje_mmap_data_get(f, "version"))) return;
41 if (atoi(version) < 110) // bump this version number when we need to
42 {
43 free(version);
44 return;
45 }
40 free(version); 46 free(version);
41 return;
42 } 47 }
43 free(version);
44 if (prepend) 48 if (prepend)
45 { 49 {
46 files->items = eina_list_prepend(files->items, 50 files->items = eina_list_prepend(files->items,
@@ -56,7 +60,7 @@ _elm_theme_item_finalize(Elm_Theme_Files *files,
56} 60}
57 61
58static void 62static void
59_elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool prepend) 63_elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool prepend, Eina_Bool istheme)
60{ 64{
61 Eina_Strbuf *buf = NULL; 65 Eina_Strbuf *buf = NULL;
62 Eina_File *f = NULL; 66 Eina_File *f = NULL;
@@ -86,7 +90,7 @@ _elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool pre
86 "%s/"ELEMENTARY_BASE_DIR"/themes/%s.edj", 90 "%s/"ELEMENTARY_BASE_DIR"/themes/%s.edj",
87 home, item); 91 home, item);
88 f = eina_file_open(eina_strbuf_string_get(buf), EINA_FALSE); 92 f = eina_file_open(eina_strbuf_string_get(buf), EINA_FALSE);
89 _elm_theme_item_finalize(files, item, f, prepend); 93 _elm_theme_item_finalize(files, item, f, prepend, istheme);
90 94
91 eina_strbuf_reset(buf); 95 eina_strbuf_reset(buf);
92 eina_strbuf_append_printf(buf, 96 eina_strbuf_append_printf(buf,
@@ -96,7 +100,7 @@ _elm_theme_file_item_add(Elm_Theme_Files *files, const char *item, Eina_Bool pre
96 /* Finalize will be done by the common one */ 100 /* Finalize will be done by the common one */
97 } 101 }
98 102
99 _elm_theme_item_finalize(files, item, f, prepend); 103 _elm_theme_item_finalize(files, item, f, prepend, istheme);
100 104
101 on_error: 105 on_error:
102 if (buf) eina_strbuf_free(buf); 106 if (buf) eina_strbuf_free(buf);
@@ -469,7 +473,7 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
469 EINA_LIST_FREE(th->themes.handles, f) eina_file_close(f); 473 EINA_LIST_FREE(th->themes.handles, f) eina_file_close(f);
470 474
471 EINA_LIST_FREE(names, p) 475 EINA_LIST_FREE(names, p)
472 _elm_theme_file_item_add(&th->themes, p, EINA_FALSE); 476 _elm_theme_file_item_add(&th->themes, p, EINA_FALSE, EINA_TRUE);
473 return EINA_TRUE; 477 return EINA_TRUE;
474} 478}
475 479
@@ -491,7 +495,7 @@ elm_theme_new(void)
491 Elm_Theme *th = calloc(1, sizeof(Elm_Theme)); 495 Elm_Theme *th = calloc(1, sizeof(Elm_Theme));
492 if (!th) return NULL; 496 if (!th) return NULL;
493 th->ref = 1; 497 th->ref = 1;
494 _elm_theme_file_item_add(&th->themes, "default", EINA_FALSE); 498 _elm_theme_file_item_add(&th->themes, "default", EINA_FALSE, EINA_TRUE);
495 themes = eina_list_append(themes, th); 499 themes = eina_list_append(themes, th);
496 return th; 500 return th;
497} 501}
@@ -579,7 +583,7 @@ elm_theme_overlay_add(Elm_Theme *th, const char *item)
579{ 583{
580 if (!item) return; 584 if (!item) return;
581 if (!th) th = &(theme_default); 585 if (!th) th = &(theme_default);
582 _elm_theme_file_item_add(&th->overlay, item, EINA_TRUE); 586 _elm_theme_file_item_add(&th->overlay, item, EINA_TRUE, EINA_FALSE);
583 elm_theme_flush(th); 587 elm_theme_flush(th);
584} 588}
585 589
@@ -598,7 +602,7 @@ elm_theme_overlay_mmap_add(Elm_Theme *th, const Eina_File *f)
598 Eina_File *file = eina_file_dup(f); 602 Eina_File *file = eina_file_dup(f);
599 603
600 if (!th) th = &(theme_default); 604 if (!th) th = &(theme_default);
601 _elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_TRUE); 605 _elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_TRUE, EINA_FALSE);
602 elm_theme_flush(th); 606 elm_theme_flush(th);
603} 607}
604 608
@@ -623,7 +627,7 @@ elm_theme_extension_add(Elm_Theme *th, const char *item)
623{ 627{
624 if (!item) return; 628 if (!item) return;
625 if (!th) th = &(theme_default); 629 if (!th) th = &(theme_default);
626 _elm_theme_file_item_add(&th->extension, item, EINA_FALSE); 630 _elm_theme_file_item_add(&th->extension, item, EINA_FALSE, EINA_FALSE);
627 elm_theme_flush(th); 631 elm_theme_flush(th);
628} 632}
629 633
@@ -643,7 +647,7 @@ elm_theme_extension_mmap_add(Elm_Theme *th, const Eina_File *f)
643 647
644 if (!f) return; 648 if (!f) return;
645 if (!th) th = &(theme_default); 649 if (!th) th = &(theme_default);
646 _elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_FALSE); 650 _elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_FALSE, EINA_FALSE);
647 elm_theme_flush(th); 651 elm_theme_flush(th);
648} 652}
649 653