forked from enlightenment/efl
efl/efreet: use proper PACKAGE_DATA_DIR, add DATA_DIR.
efreet used an uncommon PACKAGE_DATA_DIR without the package name because it used that to populate default variables. Add another variable for that and make PACKAGE_DATA_DIR more common. Tests still fails like crazy, and they assume installed data :-( SVN revision: 82426
This commit is contained in:
parent
ceaab9d37f
commit
50b9b31566
|
@ -23,7 +23,8 @@ EFREET_COMMON_CPPFLAGS = \
|
||||||
-I$(top_builddir)/src/lib/efreet \
|
-I$(top_builddir)/src/lib/efreet \
|
||||||
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
|
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
|
||||||
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
|
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
|
||||||
-DPACKAGE_DATA_DIR=\"$(datadir)\" \
|
-DPACKAGE_DATA_DIR=\"$(datadir)/efreet\" \
|
||||||
|
-DDATA_DIR=\"$(datadir)\" \
|
||||||
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
|
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
|
||||||
-DEFL_EFREET_BUILD \
|
-DEFL_EFREET_BUILD \
|
||||||
@EFL_COV_CFLAGS@ \
|
@EFL_COV_CFLAGS@ \
|
||||||
|
|
|
@ -207,11 +207,11 @@ efreet_data_dirs_get(void)
|
||||||
if (xdg_data_dirs) return xdg_data_dirs;
|
if (xdg_data_dirs) return xdg_data_dirs;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
snprintf(buf, 4096, "%s\\Efl;" PACKAGE_DATA_DIR ";/usr/share;/usr/local/share", getenv("APPDATA"));
|
snprintf(buf, 4096, "%s\\Efl;" DATA_DIR ";/usr/share;/usr/local/share", getenv("APPDATA"));
|
||||||
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf);
|
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf);
|
||||||
#else
|
#else
|
||||||
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS",
|
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS",
|
||||||
PACKAGE_DATA_DIR ":/usr/share:/usr/local/share");
|
DATA_DIR ":/usr/share:/usr/local/share");
|
||||||
#endif
|
#endif
|
||||||
return xdg_data_dirs;
|
return xdg_data_dirs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ ef_cb_efreet_data_dirs(void)
|
||||||
unsigned int ok;
|
unsigned int ok;
|
||||||
char dirs[128], *val;
|
char dirs[128], *val;
|
||||||
char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
|
char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
|
||||||
char *def_vals[] = {PACKAGE_DATA_DIR, "/usr/share", "/usr/local/share", NULL};
|
char *def_vals[] = {DATA_DIR, "/usr/share", "/usr/local/share", NULL};
|
||||||
|
|
||||||
dirs[0] = '\0';
|
dirs[0] = '\0';
|
||||||
for (i = 0; vals[i]; i++)
|
for (i = 0; vals[i]; i++)
|
||||||
|
|
|
@ -17,7 +17,7 @@ ef_cb_desktop_parse(void)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
printf("No desktop found.\n");
|
printf("No desktop found.\n");
|
||||||
|
@ -80,7 +80,7 @@ ef_cb_desktop_file_id(void)
|
||||||
Efreet_Desktop *desktop;
|
Efreet_Desktop *desktop;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
|
||||||
if (desktop)
|
if (desktop)
|
||||||
{
|
{
|
||||||
const char *id;
|
const char *id;
|
||||||
|
@ -92,10 +92,10 @@ ef_cb_desktop_file_id(void)
|
||||||
char *prefix;
|
char *prefix;
|
||||||
char *expected;
|
char *expected;
|
||||||
} tests[] = {
|
} tests[] = {
|
||||||
{PACKAGE_DATA_DIR"/efreet/test/", 0, NULL, "test.desktop"},
|
{PACKAGE_DATA_DIR"/test/", 0, NULL, "test.desktop"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/", 0, NULL, "test-test.desktop"},
|
{PACKAGE_DATA_DIR"/", 0, NULL, "test-test.desktop"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/", 1, NULL, "test.desktop"},
|
{PACKAGE_DATA_DIR"/", 1, NULL, "test.desktop"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/", 1, "prefix", "prefix-test.desktop"},
|
{PACKAGE_DATA_DIR"/", 1, "prefix", "prefix-test.desktop"},
|
||||||
{NULL, 0, NULL, NULL}
|
{NULL, 0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ ef_cb_desktop_save(void)
|
||||||
Efreet_Desktop *desktop;
|
Efreet_Desktop *desktop;
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
printf("Failed to get Desktop file\n");
|
printf("Failed to get Desktop file\n");
|
||||||
|
@ -376,7 +376,7 @@ ef_cb_desktop_type_parse(void)
|
||||||
my_type = efreet_desktop_type_add("My_Type", cb_type_parse, NULL,
|
my_type = efreet_desktop_type_add("My_Type", cb_type_parse, NULL,
|
||||||
(Efreet_Desktop_Type_Free_Cb)free);
|
(Efreet_Desktop_Type_Free_Cb)free);
|
||||||
|
|
||||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test_type.desktop");
|
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test_type.desktop");
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
printf("No desktop found.\n");
|
printf("No desktop found.\n");
|
||||||
|
|
|
@ -12,7 +12,7 @@ ef_cb_ini_parse(void)
|
||||||
|
|
||||||
putenv("LC_ALL=en_US");
|
putenv("LC_ALL=en_US");
|
||||||
|
|
||||||
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/test.ini");
|
ini = efreet_ini_new(PACKAGE_DATA_DIR"/test/test.ini");
|
||||||
if (!ini)
|
if (!ini)
|
||||||
{
|
{
|
||||||
printf("efreet_ini_parse() Failed to initialize Efreet_Ini\n");
|
printf("efreet_ini_parse() Failed to initialize Efreet_Ini\n");
|
||||||
|
@ -115,7 +115,7 @@ ef_cb_ini_long_line(void)
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/long.ini");
|
ini = efreet_ini_new(PACKAGE_DATA_DIR"/test/long.ini");
|
||||||
if (!ini)
|
if (!ini)
|
||||||
{
|
{
|
||||||
printf("Ini failed to parse.\n");
|
printf("Ini failed to parse.\n");
|
||||||
|
@ -162,7 +162,7 @@ ef_cb_ini_garbage(void)
|
||||||
Efreet_Ini *ini;
|
Efreet_Ini *ini;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/test_garbage");
|
ini = efreet_ini_new(PACKAGE_DATA_DIR"/test/test_garbage");
|
||||||
if (!ini)
|
if (!ini)
|
||||||
{
|
{
|
||||||
printf("Ini failed to parse.\n");
|
printf("Ini failed to parse.\n");
|
||||||
|
|
|
@ -32,7 +32,7 @@ ef_cb_menu_get(void)
|
||||||
Efreet_Menu *menu;
|
Efreet_Menu *menu;
|
||||||
|
|
||||||
menu = efreet_menu_get();
|
menu = efreet_menu_get();
|
||||||
// menu = efreet_menu_parse(PACKAGE_DATA_DIR"/efreet/test/test.menu");
|
// menu = efreet_menu_parse(PACKAGE_DATA_DIR"/test/test.menu");
|
||||||
if (!menu)
|
if (!menu)
|
||||||
{
|
{
|
||||||
printf("efreet_menu_get() returned NULL\n");
|
printf("efreet_menu_get() returned NULL\n");
|
||||||
|
@ -50,7 +50,7 @@ ef_cb_menu_with_slashes(void)
|
||||||
{
|
{
|
||||||
Efreet_Menu *menu;
|
Efreet_Menu *menu;
|
||||||
|
|
||||||
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/efreet/test/test_menu_slash_bad.menu");
|
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/test/test_menu_slash_bad.menu");
|
||||||
if (menu)
|
if (menu)
|
||||||
{
|
{
|
||||||
printf("efreet_menu_get() didn't return NULL\n");
|
printf("efreet_menu_get() didn't return NULL\n");
|
||||||
|
@ -67,7 +67,7 @@ ef_cb_menu_save(void)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
// menu = efreet_menu_get();
|
// menu = efreet_menu_get();
|
||||||
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/efreet/test/test.menu");
|
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/test/test.menu");
|
||||||
if (!menu)
|
if (!menu)
|
||||||
{
|
{
|
||||||
printf("efreet_menu_get() returned NULL\n");
|
printf("efreet_menu_get() returned NULL\n");
|
||||||
|
@ -86,7 +86,7 @@ ef_cb_menu_edit(void)
|
||||||
Efreet_Desktop *desktop;
|
Efreet_Desktop *desktop;
|
||||||
|
|
||||||
// menu = efreet_menu_get();
|
// menu = efreet_menu_get();
|
||||||
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/efreet/test/test.menu");
|
menu = efreet_menu_parse(PACKAGE_DATA_DIR"/test/test.menu");
|
||||||
if (!menu)
|
if (!menu)
|
||||||
{
|
{
|
||||||
printf("efreet_menu_get() returned NULL\n");
|
printf("efreet_menu_get() returned NULL\n");
|
||||||
|
@ -98,7 +98,7 @@ ef_cb_menu_edit(void)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/test/test.desktop");
|
||||||
if (!desktop)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
efreet_menu_free(menu);
|
efreet_menu_free(menu);
|
||||||
|
|
|
@ -19,10 +19,10 @@ ef_mime_cb_get(void)
|
||||||
char *file;
|
char *file;
|
||||||
char *mime;
|
char *mime;
|
||||||
} files[] = {
|
} files[] = {
|
||||||
{PACKAGE_DATA_DIR"/efreet/test/test_type.desktop", "application/x-desktop"},
|
{PACKAGE_DATA_DIR"/test/test_type.desktop", "application/x-desktop"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/test/entry.png", "image/png"},
|
{PACKAGE_DATA_DIR"/test/entry.png", "image/png"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/test/entry", "image/png"},
|
{PACKAGE_DATA_DIR"/test/entry", "image/png"},
|
||||||
{PACKAGE_DATA_DIR"/efreet/test/sub", "inode/directory"},
|
{PACKAGE_DATA_DIR"/test/sub", "inode/directory"},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
double start;
|
double start;
|
||||||
|
|
Loading…
Reference in New Issue