summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-01-19 17:12:15 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-01-19 17:12:15 +0000
commit2b7a2bfba521ea0faeb609d0663f38109c6a493b (patch)
treef9f54d3b4df0e67fa69aec5238aa03cd1f64e59a /legacy
parent8994e4038b62922825d929a1158d4d3a5dde7fa6 (diff)
elementary: be able to specify elementary private data subdirectory.
SVN revision: 67356
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/configure.ac8
-rw-r--r--legacy/elementary/src/lib/elm_config.c2
-rw-r--r--legacy/elementary/src/lib/elm_module.c6
-rw-r--r--legacy/elementary/src/lib/elm_theme.c10
4 files changed, 17 insertions, 9 deletions
diff --git a/legacy/elementary/configure.ac b/legacy/elementary/configure.ac
index abc2c29d68..bcf85e2d36 100644
--- a/legacy/elementary/configure.ac
+++ b/legacy/elementary/configure.ac
@@ -684,6 +684,14 @@ AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
684 684
685EFL_CHECK_PATH_MAX 685EFL_CHECK_PATH_MAX
686 686
687elementary_base_dir=".elementary"
688AC_ARG_WITH([elementary-base-dir],
689 [AC_HELP_STRING([--with-elementary-base-dir=PATH], [specify the subdirectory for all elementary data @<:@default=${elementary_base_dir}@:>@])],
690 [elementary_base_dir=${withval}],
691 [elementary_base_dir=".elementary"])
692
693AC_MSG_NOTICE([ELEMENTARY_BASE_DIR set to ${elementary_base_dir}])
694AC_DEFINE_UNQUOTED(ELEMENTARY_BASE_DIR, "${elementary_base_dir}", "subdirectory for all elementary data")
687 695
688### Build and install examples 696### Build and install examples
689EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"]) 697EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
diff --git a/legacy/elementary/src/lib/elm_config.c b/legacy/elementary/src/lib/elm_config.c
index ba922bcf03..3e273cc990 100644
--- a/legacy/elementary/src/lib/elm_config.c
+++ b/legacy/elementary/src/lib/elm_config.c
@@ -414,7 +414,7 @@ _elm_user_dir_snprintf(char *dst,
414 home = "/"; 414 home = "/";
415 415
416 user_dir_len = eina_str_join_len(dst, size, '/', home, strlen(home), 416 user_dir_len = eina_str_join_len(dst, size, '/', home, strlen(home),
417 ".elementary", sizeof(".elementary") - 1); 417 ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
418 418
419 off = user_dir_len + 1; 419 off = user_dir_len + 1;
420 if (off >= size) 420 if (off >= size)
diff --git a/legacy/elementary/src/lib/elm_module.c b/legacy/elementary/src/lib/elm_module.c
index 4b67b52eb9..396e9de7dc 100644
--- a/legacy/elementary/src/lib/elm_module.c
+++ b/legacy/elementary/src/lib/elm_module.c
@@ -115,7 +115,7 @@ _elm_module_load(Elm_Module *m)
115 home = getenv("HOME"); 115 home = getenv("HOME");
116 if (home) 116 if (home)
117 { 117 {
118 snprintf(buf, sizeof(buf), "%s/.elementary/modules/%s/%s/module" EFL_SHARED_EXTENSION, home, m->name, MODULE_ARCH); 118 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/modules/%s/%s/module" EFL_SHARED_EXTENSION, home, m->name, MODULE_ARCH);
119 m->module = eina_module_new(buf); 119 m->module = eina_module_new(buf);
120 if (m->module && eina_module_load (m->module) == EINA_TRUE) 120 if (m->module && eina_module_load (m->module) == EINA_TRUE)
121 { 121 {
@@ -124,9 +124,9 @@ _elm_module_load(Elm_Module *m)
124 { 124 {
125 m->shutdown_func = eina_module_symbol_get(m->module, "elm_modapi_shutdown"); 125 m->shutdown_func = eina_module_symbol_get(m->module, "elm_modapi_shutdown");
126 m->so_path = eina_stringshare_add(buf); 126 m->so_path = eina_stringshare_add(buf);
127 snprintf(buf, sizeof(buf), "%s/.elementary/modules/%s/%s", home, m->name, MODULE_ARCH); 127 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/modules/%s/%s", home, m->name, MODULE_ARCH);
128 m->bin_dir = eina_stringshare_add(buf); 128 m->bin_dir = eina_stringshare_add(buf);
129 snprintf(buf, sizeof(buf), "%s/.elementary/modules/%s", home, m->name); 129 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/modules/%s", home, m->name);
130 m->data_dir = eina_stringshare_add(buf); 130 m->data_dir = eina_stringshare_add(buf);
131 } 131 }
132 else 132 else
diff --git a/legacy/elementary/src/lib/elm_theme.c b/legacy/elementary/src/lib/elm_theme.c
index 7747d54b1a..06f340530a 100644
--- a/legacy/elementary/src/lib/elm_theme.c
+++ b/legacy/elementary/src/lib/elm_theme.c
@@ -75,7 +75,7 @@ _elm_theme_theme_element_try(Elm_Theme *th, const char *home, const char *f, con
75 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); 75 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
76 return _elm_theme_find_try(th, buf, group); 76 return _elm_theme_find_try(th, buf, group);
77 } 77 }
78 snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); 78 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s.edj", home, f);
79 file = _elm_theme_find_try(th, buf, group); 79 file = _elm_theme_find_try(th, buf, group);
80 if (file) return file; 80 if (file) return file;
81 snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f); 81 snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f);
@@ -148,7 +148,7 @@ _elm_theme_theme_data_try(Elm_Theme *th, const char *home, const char *f, const
148 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); 148 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
149 return _elm_theme_find_try(th, buf, key); 149 return _elm_theme_find_try(th, buf, key);
150 } 150 }
151 snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); 151 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s.edj", home, f);
152 data = _elm_theme_find_data_try(th, buf, key); 152 data = _elm_theme_find_data_try(th, buf, key);
153 if (data) return data; 153 if (data) return data;
154 snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f); 154 snprintf(buf, sizeof(buf), "%s/themes/%s.edj", _elm_data_dir, f);
@@ -544,7 +544,7 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
544 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); 544 snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
545 return strdup(buf); 545 return strdup(buf);
546 } 546 }
547 snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); 547 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s.edj", home, f);
548 if (ecore_file_exists(buf)) 548 if (ecore_file_exists(buf))
549 { 549 {
550 if (in_search_path) *in_search_path = EINA_TRUE; 550 if (in_search_path) *in_search_path = EINA_TRUE;
@@ -616,11 +616,11 @@ elm_theme_name_available_list_new(void)
616 if (!home) home = ""; 616 if (!home) home = "";
617 } 617 }
618 618
619 snprintf(buf, sizeof(buf), "%s/.elementary/themes", home); 619 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes", home);
620 dir = ecore_file_ls(buf); 620 dir = ecore_file_ls(buf);
621 EINA_LIST_FREE(dir, file) 621 EINA_LIST_FREE(dir, file)
622 { 622 {
623 snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s", home, file); 623 snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s", home, file);
624 if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0)) 624 if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0))
625 { 625 {
626 s = strchr(file, '.'); 626 s = strchr(file, '.');