ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/edi.git/commit/?id=80fd37a0731871c8adbb57c02ba7e6c44be1692e
commit 80fd37a0731871c8adbb57c02ba7e6c44be1692e Author: Andy Williams <a...@andywilliams.me> Date: Tue Mar 22 13:10:04 2016 +0000 Fix the local lookup of diffs in the test app. This is not portable but I think it's a temporary app anyhow --- elm_code/src/bin/Makefile.am | 1 + elm_code/src/bin/elm_code_test_main.c | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/elm_code/src/bin/Makefile.am b/elm_code/src/bin/Makefile.am index c71bf8b..58105bc 100644 --- a/elm_code/src/bin/Makefile.am +++ b/elm_code/src/bin/Makefile.am @@ -9,6 +9,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/elm_code/src/lib/ \ -I$(top_builddir)/elm_code/src/lib/ \ -DLOCALEDIR=\"$(datadir)/locale\" \ +-DDATA_DIR=\"$(abspath $(srcdir))/../tests/\" \ -DEFL_BETA_API_SUPPORT \ @EFL_CFLAGS@ diff --git a/elm_code/src/bin/elm_code_test_main.c b/elm_code/src/bin/elm_code_test_main.c index 5779ee7..b4bcf30 100644 --- a/elm_code/src/bin/elm_code_test_main.c +++ b/elm_code/src/bin/elm_code_test_main.c @@ -135,15 +135,10 @@ _elm_code_test_mirror_setup(Elm_Code *code, char *font_name, Evas_Object *parent static Evas_Object * _elm_code_test_diff_inline_setup(Evas_Object *parent) { - char path[PATH_MAX]; Evas_Object *diff; Elm_Code *code; - snprintf(path, sizeof(path), "%s/../edi/data/testdiff.diff", elm_app_data_dir_get()); - code = elm_code_create(); - elm_code_file_open(code, path); - diff = eo_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(eo_self, code)); evas_object_size_hint_weight_set(diff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -151,7 +146,7 @@ _elm_code_test_diff_inline_setup(Evas_Object *parent) evas_object_show(diff); elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF); - elm_code_file_open(code, path); + elm_code_file_open(code, DATA_DIR "testdiff.diff"); return diff; } @@ -159,14 +154,11 @@ _elm_code_test_diff_inline_setup(Evas_Object *parent) static Evas_Object * _elm_code_test_diff_setup(Evas_Object *parent) { - char path[PATH_MAX]; Evas_Object *diff; Elm_Code *code; - snprintf(path, sizeof(path), "%s/../edi/data/testdiff.diff", elm_app_data_dir_get()); - code = elm_code_create(); - elm_code_file_open(code, path); + elm_code_file_open(code, DATA_DIR "testdiff.diff"); diff = elm_code_diff_widget_add(parent, code); return diff; --